hd-idevvue3 3.0.7 → 3.0.9
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/dist/{static/js/index-DbUA6jg0.js → index.js} +1 -1
- package/package.json +7 -2
- package/.env.development +0 -5
- package/.env.production +0 -5
- package/.eslintrc.js +0 -151
- package/dist/static/js/index-Dl4O91nB.js +0 -73768
- package/index.html +0 -18
- package/pnpm-lock.yaml +0 -3541
- package/src/App.vue +0 -11
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +0 -42
- package/src/demo/dropdemo.vue +0 -42
- package/src/demo/extsets.vue +0 -208
- package/src/demo/formedit.vue +0 -157
- package/src/demo/hightquery.vue +0 -366
- package/src/demo/inlineedit.vue +0 -182
- package/src/demo/selfdrop.vue +0 -58
- package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
- package/src/directive/el-dragDialog/drag.js +0 -124
- package/src/directive/el-dragDialog/index.js +0 -13
- package/src/errorLog.js +0 -16
- package/src/hdcom/BigGrid.js +0 -179
- package/src/hdcom/BillShow.vue +0 -111
- package/src/hdcom/BillUpload.vue +0 -311
- package/src/hdcom/BtnRight.vue +0 -101
- package/src/hdcom/ErrHint.vue +0 -42
- package/src/hdcom/ExtendColumn.vue +0 -115
- package/src/hdcom/ExtendCommon.js +0 -40
- package/src/hdcom/ExtendForm.vue +0 -141
- package/src/hdcom/FacePicUpload.vue +0 -80
- package/src/hdcom/FaceRecTest.vue +0 -114
- package/src/hdcom/GridChart.vue +0 -207
- package/src/hdcom/GridExField.vue +0 -375
- package/src/hdcom/GridShow.vue +0 -288
- package/src/hdcom/HdAside.vue +0 -225
- package/src/hdcom/HdBtn.vue +0 -125
- package/src/hdcom/HdButton.vue +0 -161
- package/src/hdcom/HdComFaceRec.vue +0 -106
- package/src/hdcom/HdComGrid.vue +0 -876
- package/src/hdcom/HdComQuery.vue +0 -362
- package/src/hdcom/HdComQueryDetail.vue +0 -205
- package/src/hdcom/HdComSortDetail.vue +0 -161
- package/src/hdcom/HdDatePicker.vue +0 -94
- package/src/hdcom/HdDialog.vue +0 -81
- package/src/hdcom/HdDrop.vue +0 -188
- package/src/hdcom/HdFileUpload.vue +0 -167
- package/src/hdcom/HdFilterBox.vue +0 -90
- package/src/hdcom/HdFooter.vue +0 -182
- package/src/hdcom/HdForm.vue +0 -351
- package/src/hdcom/HdFormBtn.vue +0 -131
- package/src/hdcom/HdFormItem.vue +0 -39
- package/src/hdcom/HdGctosGrid +0 -0
- package/src/hdcom/HdGrid.vue +0 -1022
- package/src/hdcom/HdGridEditBtn.vue +0 -58
- package/src/hdcom/HdGridExt.js +0 -250
- package/src/hdcom/HdGridSel.vue +0 -257
- package/src/hdcom/HdHeader.vue +0 -180
- package/src/hdcom/HdHotKey.vue +0 -84
- package/src/hdcom/HdInputHint.vue +0 -53
- package/src/hdcom/HdMain.vue +0 -41
- package/src/hdcom/HdMessage.vue +0 -201
- package/src/hdcom/HdNum.vue +0 -79
- package/src/hdcom/HdPopSel.vue +0 -80
- package/src/hdcom/HdRightMenu.vue +0 -63
- package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
- package/src/hdcom/HdTableColumn.vue +0 -381
- package/src/hdcom/HdTempSave.vue +0 -162
- package/src/hdcom/HdTree.vue +0 -103
- package/src/hdcom/HdTreeTable/eval.js +0 -39
- package/src/hdcom/HdTreeTable/index.vue +0 -229
- package/src/hdcom/ImportExcel.vue +0 -178
- package/src/hdcom/index.js +0 -75
- package/src/idev.common.js +0 -79
- package/src/index.js +0 -11
- package/src/utils/HdQuery.js +0 -65
- package/src/utils/comutils.js +0 -120
- package/src/utils/gogocodeTransfer.js +0 -59
- package/src/utils/utils.js +0 -116
- package/src/vendor/Blob.js +0 -187
- package/src/vendor/Export2Excel.js +0 -231
- package/src/vendor/Export2Zip.js +0 -25
- package/src/views/layout/AppMain.vue +0 -34
- package/src/views/layout/HdLayout.vue +0 -90
- package/src/views/layout/header/ElasticSearch.vue +0 -262
- package/src/views/layout/header/HZRecorder.js +0 -259
- package/src/views/layout/header/HeaderSearch.vue +0 -218
- package/src/views/layout/header/Levelbar.vue +0 -55
- package/src/views/layout/header/MainHeader.vue +0 -315
- package/src/views/layout/header/Navbar.vue +0 -101
- package/src/views/layout/header/ScrollPane.vue +0 -103
- package/src/views/layout/header/TagsView.vue +0 -215
- package/src/views/layout/header/VocRec.vue +0 -105
- package/src/views/layout/header/changepswform.vue +0 -130
- package/src/views/layout/index.js +0 -10
- package/src/views/layout/menu/Hamburger.vue +0 -63
- package/src/views/layout/menu/HdMenu.vue +0 -204
- package/src/views/layout/menu/css/menu.css +0 -288
- package/src/views/layout/menu/index.vue +0 -27
- package/src/views/privilege/commsg/commsg.vue +0 -152
- package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
- package/src/views/privilege/commsg/commsgRole.vue +0 -220
- package/src/views/privilege/commsg/commsgform.vue +0 -184
- package/src/views/privilege/commsg/commsgiframe.vue +0 -40
- package/src/views/privilege/commsg/commsgto.vue +0 -199
- package/src/views/privilege/commsg/commsgtoform.vue +0 -114
- package/src/views/privilege/commsg/commsgtrans.vue +0 -227
- package/src/views/privilege/exfield/comexcolumn.vue +0 -161
- package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
- package/src/views/privilege/exfield/comexfield.vue +0 -29
- package/src/views/privilege/exfield/comexfieldform.vue +0 -112
- package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
- package/src/views/privilege/index.js +0 -41
- package/src/views/privilege/menu/comMenu.vue +0 -49
- package/src/views/privilege/menu/menu.vue +0 -250
- package/src/views/privilege/menu/menuinfo.vue +0 -63
- package/src/views/privilege/menu/rolelist.vue +0 -92
- package/src/views/privilege/menu/userlist.vue +0 -92
- package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
- package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
- package/src/views/privilege/orgDept/authOrgn.vue +0 -188
- package/src/views/privilege/orgDept/authorgnform.vue +0 -157
- package/src/views/privilege/orgDept/orgDept.vue +0 -38
- package/src/views/privilege/orgDept/orgTree.vue +0 -99
- package/src/views/privilege/orgDept/orgnselect.vue +0 -155
- package/src/views/privilege/personDept/authuser.vue +0 -229
- package/src/views/privilege/personDept/authuserform.vue +0 -206
- package/src/views/privilege/personDept/facerec.vue +0 -162
- package/src/views/privilege/personDept/orgncascader.vue +0 -144
- package/src/views/privilege/personDept/personDept.vue +0 -33
- package/src/views/privilege/quartz/comquartzjob.vue +0 -150
- package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
- package/src/views/privilege/quartz/comquartzlog.vue +0 -143
- package/src/views/privilege/role/btnRole.vue +0 -173
- package/src/views/privilege/role/menuRole.vue +0 -84
- package/src/views/privilege/role/orgnRole.vue +0 -78
- package/src/views/privilege/role/role.vue +0 -84
- package/src/views/privilege/role/rolelist.vue +0 -136
- package/src/views/privilege/role/roleselect.vue +0 -74
- package/src/views/privilege/search/comsearch.vue +0 -196
- package/src/views/privilege/search/menu.vue +0 -68
- package/src/views/privilege/syscode/syscode.vue +0 -191
- package/src/views/privilege/syscode/sysfield.vue +0 -119
- package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
- package/src/views/privilege/syslog/menulog.vue +0 -68
- package/src/views/privilege/syslog/syslog.vue +0 -182
- package/src/views/privilege/syslog/syslogconfig.vue +0 -128
- package/src/views/privilege/syslog/syslogform.vue +0 -85
- package/src/views/privilege/syslog/syslogframe.vue +0 -26
- package/src/views/privilege/userRole/userRole.vue +0 -220
- package/vite.config.js +0 -124
- /package/dist/{static/css/index-DRHIlcVU.css → index.css} +0 -0
package/src/hdcom/index.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import HdDrop from './HdDrop'
|
|
2
|
-
import HdGrid from './HdGrid'
|
|
3
|
-
import HdBtn from './HdBtn'
|
|
4
|
-
import HdButton from './HdButton'
|
|
5
|
-
import HdNum from './HdNum'
|
|
6
|
-
import HdDatePicker from './HdDatePicker'
|
|
7
|
-
import HdTreeTable from './HdTreeTable/index.vue'
|
|
8
|
-
import HdDialog from './HdDialog'
|
|
9
|
-
import HdAside from './HdAside.vue'
|
|
10
|
-
import HdFooter from './HdFooter'
|
|
11
|
-
import HdHeader from './HdHeader'
|
|
12
|
-
import HdMain from './HdMain'
|
|
13
|
-
import HdTree from './HdTree'
|
|
14
|
-
import HdPopSel from './HdPopSel'
|
|
15
|
-
import '../utils/utils.js'
|
|
16
|
-
import HdHotkey from './HdHotkey' // 实际为shortkey组件
|
|
17
|
-
import HdComGrid from './HdComGrid'
|
|
18
|
-
import HdForm from './HdForm'
|
|
19
|
-
import HdFormBtn from './HdFormBtn'
|
|
20
|
-
import HdFormItem from './HdFormItem.vue'
|
|
21
|
-
import HdTableColumn from './HdTableColumn.vue'
|
|
22
|
-
import ErrHint from './ErrHint.vue'
|
|
23
|
-
import HdMessage from './HdMessage.vue'
|
|
24
|
-
import HdFileUpload from './HdFileUpload.vue'
|
|
25
|
-
import HdGridSel from './HdGridSel.vue'
|
|
26
|
-
import HdGridEditBtn from './HdGridEditBtn'
|
|
27
|
-
import HdTempSave from './HdTempSave'
|
|
28
|
-
import HdComFaceRec from './HdComFaceRec.vue'
|
|
29
|
-
import HdInputHint from './HdInputHint'
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
install(Vue) {
|
|
33
|
-
window.$vueApp.use(require('vue-shortkey'))
|
|
34
|
-
Vue._window = window
|
|
35
|
-
window.$vueApp.component('HdDrop', HdDrop)
|
|
36
|
-
window.$vueApp.component('HdGrid', HdGrid)
|
|
37
|
-
window.$vueApp.component('HdBtn', HdBtn)
|
|
38
|
-
window.$vueApp.component('HdNum', HdNum)
|
|
39
|
-
window.$vueApp.component('elTreeTable', HdTreeTable)
|
|
40
|
-
window.$vueApp.component('elButton', HdButton) // 替换element ui
|
|
41
|
-
window.$vueApp.component('elDialog', HdDialog)
|
|
42
|
-
window.$vueApp.component('elAside', HdAside)
|
|
43
|
-
window.$vueApp.component('elFooter', HdFooter)
|
|
44
|
-
window.$vueApp.component('elHeader', HdHeader)
|
|
45
|
-
window.$vueApp.component('elMain', HdMain)
|
|
46
|
-
window.$vueApp.component('HdTreeTable', HdTreeTable)
|
|
47
|
-
window.$vueApp.component('HdButton', HdButton) // 替换element ui
|
|
48
|
-
window.$vueApp.component('HdDialog', HdDialog)
|
|
49
|
-
window.$vueApp.component('HdAside', HdAside)
|
|
50
|
-
window.$vueApp.component('HdFooter', HdFooter)
|
|
51
|
-
window.$vueApp.component('HdHeader', HdHeader)
|
|
52
|
-
window.$vueApp.component('HdMain', HdMain)
|
|
53
|
-
window.$vueApp.component('HdInputHint', HdInputHint)
|
|
54
|
-
|
|
55
|
-
// Vue.component('el-popover', HdPopover)
|
|
56
|
-
window.$vueApp.component('elFormItem', HdFormItem)
|
|
57
|
-
window.$vueApp.component('HdFormItem', HdFormItem)
|
|
58
|
-
window.$vueApp.component('HdTree', HdTree)
|
|
59
|
-
window.$vueApp.component('HdDatePicker', HdDatePicker)
|
|
60
|
-
window.$vueApp.component('HdHotKey', HdHotkey)
|
|
61
|
-
window.$vueApp.component('HdComGrid', HdComGrid)
|
|
62
|
-
window.$vueApp.component('HdForm', HdForm)
|
|
63
|
-
window.$vueApp.component('HdFormBtn', HdFormBtn)
|
|
64
|
-
window.$vueApp.component('HdPopSel', HdPopSel)
|
|
65
|
-
window.$vueApp.component('elTableColumn', HdTableColumn)
|
|
66
|
-
window.$vueApp.component('HdTableColumn', HdTableColumn)
|
|
67
|
-
window.$vueApp.component('ErrHint', ErrHint)
|
|
68
|
-
window.$vueApp.component('HdMessage', HdMessage)
|
|
69
|
-
window.$vueApp.component('HdFileUpload', HdFileUpload)
|
|
70
|
-
window.$vueApp.component('HdGridSel', HdGridSel)
|
|
71
|
-
window.$vueApp.component('HdGridEditBtn', HdGridEditBtn)
|
|
72
|
-
window.$vueApp.component('HdTempSave', HdTempSave)
|
|
73
|
-
window.$vueApp.component('HdComFaceRec', HdComFaceRec)
|
|
74
|
-
},
|
|
75
|
-
}
|
package/src/idev.common.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import hdcom from './hdcom'
|
|
2
|
-
import comutils from './utils/comutils'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
install(Vue, options, inElement) {
|
|
6
|
-
try {
|
|
7
|
-
let ver = require('../package.json').version
|
|
8
|
-
console.info('您现在使用的是hd-idevvue2:' + ver)
|
|
9
|
-
} catch (e) {}
|
|
10
|
-
|
|
11
|
-
//滚动去掉高亮事件,提升虚拟滚动条性能
|
|
12
|
-
;(inElement.Table.components.TableBody.methods.handleMouseEnter =
|
|
13
|
-
function handleMouseEnter(index) {
|
|
14
|
-
//去掉eltable的hover事件
|
|
15
|
-
if (this.store.states.hoverRow != 'locked') {
|
|
16
|
-
this.store.commit('setHoverRow', index)
|
|
17
|
-
}
|
|
18
|
-
}),
|
|
19
|
-
(inElement.Table.components.TableBody.methods.handleMouseLeave =
|
|
20
|
-
function handleMouseLeave(index) {
|
|
21
|
-
//去掉eltable的hover事件
|
|
22
|
-
if (this.store.states.hoverRow != 'locked') {
|
|
23
|
-
this.store.commit('setHoverRow', null)
|
|
24
|
-
}
|
|
25
|
-
}),
|
|
26
|
-
(inElement.Table.components.TableBody.methods.getColspanRealWidth =
|
|
27
|
-
function getColspanRealWidth(columns, colspan, index) {
|
|
28
|
-
if (colspan < 1) {
|
|
29
|
-
return columns[index].realWidth
|
|
30
|
-
}
|
|
31
|
-
const widthArr = columns
|
|
32
|
-
.map(({ realWidth }) => realWidth)
|
|
33
|
-
.slice(index, index + colspan)
|
|
34
|
-
return widthArr.reduce((acc, width) => acc + width, 0)
|
|
35
|
-
}),
|
|
36
|
-
(inElement.Input.props.clearable = {
|
|
37
|
-
// clearable默认生效
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true,
|
|
40
|
-
})
|
|
41
|
-
inElement.Input.props.value = {
|
|
42
|
-
// 不写会出现undefined
|
|
43
|
-
type: [String, Number],
|
|
44
|
-
default: '',
|
|
45
|
-
}
|
|
46
|
-
//element ui自身组件进行了扩展,如果使用纯原生的可以使用Ex***,或者自己import
|
|
47
|
-
window.$vueApp.component('ExFooter', inElement.Footer)
|
|
48
|
-
window.$vueApp.component('ExMain', inElement.Main)
|
|
49
|
-
window.$vueApp.component('ExAside', inElement.Aside)
|
|
50
|
-
window.$vueApp.component('ExHeader', inElement.Header)
|
|
51
|
-
window.$vueApp.component('ExDialog', inElement.Dialog) //这里引入,然后HdDialog调用,保证了一个vue对象,zIndex才能正常
|
|
52
|
-
window.$vueApp.component('ExFormItem', inElement.FormItem)
|
|
53
|
-
window.$vueApp.component('ExFormItem', inElement.FormItem)
|
|
54
|
-
window.$vueApp.component('ExButton', inElement.Button)
|
|
55
|
-
window.$vueApp.component('ExTableColumn', inElement.TableColumn)
|
|
56
|
-
window.$vueApp.component('ExDatePicker', inElement.DatePicker)
|
|
57
|
-
window.$vueApp.use(inElement, options)
|
|
58
|
-
window.$vueApp.use(comutils)
|
|
59
|
-
window.$vueApp.use(hdcom)
|
|
60
|
-
window.$vueApp.config.globalProperties.$message = function (options) {
|
|
61
|
-
// 消息默认值
|
|
62
|
-
if (!options.duration) {
|
|
63
|
-
if (options.type == 'error') {
|
|
64
|
-
options.duration = 3000
|
|
65
|
-
} else {
|
|
66
|
-
options.duration = 5000
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (!options.showClose) {
|
|
70
|
-
options.showClose = true
|
|
71
|
-
}
|
|
72
|
-
inElement.Message(options)
|
|
73
|
-
}
|
|
74
|
-
window.$vueApp.config.globalProperties.$message.closeAll =
|
|
75
|
-
inElement.Message.closeAll
|
|
76
|
-
window.$vueApp.config.globalProperties.$message.close =
|
|
77
|
-
inElement.Message.close
|
|
78
|
-
},
|
|
79
|
-
}
|
package/src/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import common from './idev.common'
|
|
2
|
-
import privilege from './views/privilege'
|
|
3
|
-
import layout from './views/layout'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
install(Vue, options, inElement) {
|
|
7
|
-
common.install(Vue, options, inElement)
|
|
8
|
-
window.$vueApp.use(privilege)
|
|
9
|
-
window.$vueApp.use(layout)
|
|
10
|
-
},
|
|
11
|
-
}
|
package/src/utils/HdQuery.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export default (st, pageRows, queryMethod) => {
|
|
2
|
-
//st页面this对象,pageRows,每页显示行数,queryMethod如果默认查询不是doQuery需要指定字符串
|
|
3
|
-
let _thisst = st
|
|
4
|
-
let query = {}
|
|
5
|
-
let page = 1
|
|
6
|
-
let rows = 20
|
|
7
|
-
if (pageRows) {
|
|
8
|
-
rows = pageRows
|
|
9
|
-
}
|
|
10
|
-
let q = ''
|
|
11
|
-
let sort = ''
|
|
12
|
-
let order = 'desc'
|
|
13
|
-
let selObj = [] //checkbox勾选的对象
|
|
14
|
-
let doQueryMethod = queryMethod
|
|
15
|
-
? '_thisst.' + queryMethod + '()'
|
|
16
|
-
: '_thisst.doQuery()'
|
|
17
|
-
|
|
18
|
-
let outObj = {
|
|
19
|
-
query,
|
|
20
|
-
page,
|
|
21
|
-
rows,
|
|
22
|
-
q,
|
|
23
|
-
sort,
|
|
24
|
-
order,
|
|
25
|
-
selObj,
|
|
26
|
-
doQueryMethod,
|
|
27
|
-
|
|
28
|
-
add: (key, value) => {
|
|
29
|
-
//没啥用
|
|
30
|
-
query[key] = value
|
|
31
|
-
},
|
|
32
|
-
setThis(st) {
|
|
33
|
-
_thisst = st
|
|
34
|
-
},
|
|
35
|
-
doSizeChg(val) {
|
|
36
|
-
//显示行数切换
|
|
37
|
-
outObj.rows = val
|
|
38
|
-
return eval(doQueryMethod)
|
|
39
|
-
|
|
40
|
-
//st.doQuery()
|
|
41
|
-
},
|
|
42
|
-
doCurPageChange(val) {
|
|
43
|
-
//页码切换
|
|
44
|
-
outObj.page = val
|
|
45
|
-
|
|
46
|
-
return eval(doQueryMethod)
|
|
47
|
-
},
|
|
48
|
-
doSort(val, noQuery) {
|
|
49
|
-
outObj.sort = val.prop
|
|
50
|
-
if (val.order == 'ascending') {
|
|
51
|
-
outObj.order = 'asc'
|
|
52
|
-
} else if (val.order == 'descending') {
|
|
53
|
-
outObj.order = 'desc'
|
|
54
|
-
} else {
|
|
55
|
-
outObj.sort = ''
|
|
56
|
-
outObj.order = ''
|
|
57
|
-
}
|
|
58
|
-
if (!noQuery) {
|
|
59
|
-
//true 不查询,适合列表一加载时
|
|
60
|
-
return eval(doQueryMethod)
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
}
|
|
64
|
-
return outObj
|
|
65
|
-
}
|
package/src/utils/comutils.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
function genRules(
|
|
2
|
-
isRequired,
|
|
3
|
-
minLength,
|
|
4
|
-
maxLength,
|
|
5
|
-
type = 'string',
|
|
6
|
-
decimalNum
|
|
7
|
-
) {
|
|
8
|
-
// decimalNum=0是整数
|
|
9
|
-
const result = []
|
|
10
|
-
if (isRequired) {
|
|
11
|
-
const msg = { message: this.$t('此处必填'), required: true }
|
|
12
|
-
result.push(msg)
|
|
13
|
-
}
|
|
14
|
-
if (type == 'string') {
|
|
15
|
-
if (minLength) {
|
|
16
|
-
result.push({
|
|
17
|
-
min: minLength,
|
|
18
|
-
message: this.$t('字符长度不能小于x个字符', [minLength]),
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
if (maxLength) {
|
|
22
|
-
result.push({
|
|
23
|
-
max: maxLength,
|
|
24
|
-
message: this.$t('字符长度不能大于x个字符', [maxLength]),
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
} else if (type == 'number') {
|
|
28
|
-
result.push({ type: 'number', message: this.$t('必须为数字') })
|
|
29
|
-
if (minLength != null) {
|
|
30
|
-
result.push({
|
|
31
|
-
type: 'number',
|
|
32
|
-
min: minLength,
|
|
33
|
-
message: this.$t('数字不能小于') + minLength,
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
if (maxLength) {
|
|
37
|
-
result.push({
|
|
38
|
-
type: 'number',
|
|
39
|
-
max: maxLength,
|
|
40
|
-
message: this.$t('数字不能大于') + maxLength,
|
|
41
|
-
})
|
|
42
|
-
}
|
|
43
|
-
if (decimalNum) {
|
|
44
|
-
// 非0时,有小数
|
|
45
|
-
const reg = new RegExp('^(\\-|\\+?)\\d+(\\.\\d{0,' + decimalNum + '})?$')
|
|
46
|
-
result.push({
|
|
47
|
-
pattern: reg,
|
|
48
|
-
message: this.$t('小数最多x位', [decimalNum]),
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
if (decimalNum === 0) {
|
|
52
|
-
const reg = new RegExp('(^-?\\d+$)')
|
|
53
|
-
result.push({ pattern: reg, message: this.$t('请输入整数') })
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return result
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ckFt(value) {
|
|
61
|
-
// checkbox展示用
|
|
62
|
-
if (value == '1') {
|
|
63
|
-
return '√'
|
|
64
|
-
} else {
|
|
65
|
-
return '×'
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function date() {
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default {
|
|
74
|
-
install(Vue) {
|
|
75
|
-
window.$vueApp.config.globalProperties.$r = genRules
|
|
76
|
-
window.$vueApp.config.globalProperties.$ckFt = ckFt
|
|
77
|
-
window.$vueApp.config.globalProperties.$date = {
|
|
78
|
-
type: 'date',
|
|
79
|
-
placeholder: '选择日期',
|
|
80
|
-
format: 'yyyy-MM-dd',
|
|
81
|
-
valueFormat: 'yyyy-MM-dd',
|
|
82
|
-
style: { width: '100%' },
|
|
83
|
-
}
|
|
84
|
-
window.$vueApp.config.globalProperties.$time = {
|
|
85
|
-
type: 'datetime',
|
|
86
|
-
placeholder: '选择时间',
|
|
87
|
-
format: 'yyyy-MM-dd HH:mm',
|
|
88
|
-
valueFormat: 'yyyy-MM-dd HH:mm',
|
|
89
|
-
style: { width: '100%' },
|
|
90
|
-
}
|
|
91
|
-
window.$vueApp.config.globalProperties.$simdate = {
|
|
92
|
-
type: 'date',
|
|
93
|
-
placeholder: '选择日期',
|
|
94
|
-
format: 'yy-MM-dd',
|
|
95
|
-
valueFormat: 'yyyy-MM-dd',
|
|
96
|
-
style: { width: '100%' },
|
|
97
|
-
}
|
|
98
|
-
window.$vueApp.config.globalProperties.$simtime = {
|
|
99
|
-
type: 'datetime',
|
|
100
|
-
placeholder: '选择时间',
|
|
101
|
-
format: 'yy-MM-dd HH:mm',
|
|
102
|
-
valueFormat: 'yyyy-MM-dd HH:mm',
|
|
103
|
-
style: { width: '100%' },
|
|
104
|
-
}
|
|
105
|
-
window.$vueApp.config.globalProperties.$simdateshow = (v) => {
|
|
106
|
-
if (v) {
|
|
107
|
-
return v.substring(2, 10)
|
|
108
|
-
} else {
|
|
109
|
-
return ''
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
window.$vueApp.config.globalProperties.$simtimeshow = (v) => {
|
|
113
|
-
if (v) {
|
|
114
|
-
return v.substring(2)
|
|
115
|
-
} else {
|
|
116
|
-
return ''
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const eventRegistryMap = new WeakMap()
|
|
2
|
-
function getRegistry(instance) {
|
|
3
|
-
let events = eventRegistryMap.get(instance)
|
|
4
|
-
if (!events) {
|
|
5
|
-
eventRegistryMap.set(instance, (events = Object.create(null)))
|
|
6
|
-
}
|
|
7
|
-
return events
|
|
8
|
-
}
|
|
9
|
-
export function $on(instance, event, fn) {
|
|
10
|
-
if (Array.isArray(event)) {
|
|
11
|
-
event.forEach((e) => $on(instance, e, fn))
|
|
12
|
-
} else {
|
|
13
|
-
const events = getRegistry(instance)
|
|
14
|
-
;(events[event] || (events[event] = [])).push(fn)
|
|
15
|
-
}
|
|
16
|
-
return instance
|
|
17
|
-
}
|
|
18
|
-
export function $once(instance, event, fn) {
|
|
19
|
-
const wrapped = (...args) => {
|
|
20
|
-
$off(instance, event, wrapped)
|
|
21
|
-
fn.call(instance, ...args)
|
|
22
|
-
}
|
|
23
|
-
wrapped.fn = fn
|
|
24
|
-
$on(instance, event, wrapped)
|
|
25
|
-
return instance
|
|
26
|
-
}
|
|
27
|
-
export function $off(instance, event, fn) {
|
|
28
|
-
const vm = instance
|
|
29
|
-
// all
|
|
30
|
-
if (!event) {
|
|
31
|
-
eventRegistryMap.set(instance, Object.create(null))
|
|
32
|
-
return vm
|
|
33
|
-
}
|
|
34
|
-
// array of events
|
|
35
|
-
if (Array.isArray(event)) {
|
|
36
|
-
event.forEach((e) => $off(instance, e, fn))
|
|
37
|
-
return vm
|
|
38
|
-
}
|
|
39
|
-
// specific event
|
|
40
|
-
const events = getRegistry(instance)
|
|
41
|
-
const cbs = events[event]
|
|
42
|
-
if (!cbs) {
|
|
43
|
-
return vm
|
|
44
|
-
}
|
|
45
|
-
if (!fn) {
|
|
46
|
-
events[event] = undefined
|
|
47
|
-
return vm
|
|
48
|
-
}
|
|
49
|
-
events[event] = cbs.filter((cb) => !(cb === fn || cb.fn === fn))
|
|
50
|
-
return vm
|
|
51
|
-
}
|
|
52
|
-
export function $emit(instance, event, ...args) {
|
|
53
|
-
instance && instance.$emit && instance.$emit(event, ...args)
|
|
54
|
-
const cbs = getRegistry(instance)[event]
|
|
55
|
-
if (cbs) {
|
|
56
|
-
cbs.map((cb) => cb.apply(instance, args))
|
|
57
|
-
}
|
|
58
|
-
return instance
|
|
59
|
-
}
|
package/src/utils/utils.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
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(
|
|
13
|
-
RegExp.$1,
|
|
14
|
-
(this.getFullYear() + '').substr(4 - RegExp.$1.length)
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
for (var i in args) {
|
|
18
|
-
var n = args[i]
|
|
19
|
-
if (new RegExp('(' + i + ')').test(format)) {
|
|
20
|
-
format = format.replace(
|
|
21
|
-
RegExp.$1,
|
|
22
|
-
RegExp.$1.length == 1 ? n : ('00' + n).substr(('' + n).length)
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return format
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
String.prototype.formatStr = function (format) {
|
|
30
|
-
var date = this
|
|
31
|
-
if (!format) format = 'yyyy-MM-dd'
|
|
32
|
-
switch (typeof date) {
|
|
33
|
-
case 'string':
|
|
34
|
-
date = new Date(date.replace(/-/, '/'))
|
|
35
|
-
break
|
|
36
|
-
case 'number':
|
|
37
|
-
date = new Date(date)
|
|
38
|
-
break
|
|
39
|
-
default:
|
|
40
|
-
date = new Date(date.toString().replace(/-/, '/'))
|
|
41
|
-
break
|
|
42
|
-
}
|
|
43
|
-
if (!date instanceof Date) return
|
|
44
|
-
var dict = {
|
|
45
|
-
yyyy: date.getFullYear(),
|
|
46
|
-
M: date.getMonth() + 1,
|
|
47
|
-
d: date.getDate(),
|
|
48
|
-
H: date.getHours(),
|
|
49
|
-
m: date.getMinutes(),
|
|
50
|
-
s: date.getSeconds(),
|
|
51
|
-
MM: ('' + (date.getMonth() + 101)).substr(1),
|
|
52
|
-
dd: ('' + (date.getDate() + 100)).substr(1),
|
|
53
|
-
HH: ('' + (date.getHours() + 100)).substr(1),
|
|
54
|
-
mm: ('' + (date.getMinutes() + 100)).substr(1),
|
|
55
|
-
ss: ('' + (date.getSeconds() + 100)).substr(1),
|
|
56
|
-
}
|
|
57
|
-
return format.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, function () {
|
|
58
|
-
return dict[arguments[0]]
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
String.prototype.replaceAll = function (oldStr, newStr) {
|
|
62
|
-
return this.replace(new RegExp(oldStr, 'gm'), newStr)
|
|
63
|
-
}
|
|
64
|
-
// 遍历整个数组,移除匹配item的元素,使用强比较===,给第二个参数的话就从头开始找到第一个匹配item元素移除后返回;
|
|
65
|
-
// 如有找到元素返回处理后的数组自身,如果没有找到过就返回undefined;
|
|
66
|
-
Array.prototype.remove = function (item, all) {
|
|
67
|
-
let result,
|
|
68
|
-
isType = Object.prototype.toString,
|
|
69
|
-
i,
|
|
70
|
-
len,
|
|
71
|
-
start,
|
|
72
|
-
hasLast = arguments[2]
|
|
73
|
-
;(start = 0), (len = this.length)
|
|
74
|
-
for (i = start; i < len; ) {
|
|
75
|
-
var isPass = true,
|
|
76
|
-
inx
|
|
77
|
-
if (!hasLast) {
|
|
78
|
-
inx = i
|
|
79
|
-
} else {
|
|
80
|
-
inx = len - 1
|
|
81
|
-
}
|
|
82
|
-
if (isType.call(item) == '[object Array]') {
|
|
83
|
-
for (var ii = 0, iimax = item.length; ii < iimax; ii++) {
|
|
84
|
-
if (this[inx] === item[ii]) {
|
|
85
|
-
isPass = false
|
|
86
|
-
break
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
} else if (this[inx] === item) {
|
|
90
|
-
isPass = false
|
|
91
|
-
}
|
|
92
|
-
if (!isPass) {
|
|
93
|
-
result = true
|
|
94
|
-
this.splice(inx, 1)
|
|
95
|
-
if (all) {
|
|
96
|
-
break
|
|
97
|
-
}
|
|
98
|
-
} else if (!hasLast) {
|
|
99
|
-
len = this.length
|
|
100
|
-
i++
|
|
101
|
-
} else {
|
|
102
|
-
len--
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return result ? this : void 0
|
|
106
|
-
}
|
|
107
|
-
// 删除一个并返回当前位置,匹配不到返回-1
|
|
108
|
-
Array.prototype.removeone = function (item) {
|
|
109
|
-
for (let i = 0; i < this.length; i++) {
|
|
110
|
-
if (this[i] === item) {
|
|
111
|
-
this.splice(i, 1)
|
|
112
|
-
return i
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return -1
|
|
116
|
-
}
|