提交 7282d3d1 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 新增考勤插件包sy-checkin

上级 5a1a4cf2
var L = Object.defineProperty;
var D = (t, r, e) => r in t ? L(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
var h = (t, r, e) => (D(t, typeof r != "symbol" ? r + "" : r, e), e);
import { PluginStaticResource as g } from "@ibiz-template/runtime";
import { defineComponent as y, ref as O, watch as I, computed as p, getCurrentInstance as A, h as d } from "vue";
import { getCheckboxProps as P, getEditorEmits as k, useNamespace as C, useControlController as F } from "@ibiz-template/vue-util";
import { isNil as j } from "ramda";
import { CheckBoxListEditorController as w, SearchFormController as N, FormNotifyState as T } from "@ibiz-template/controller";
import { SearchFormModel as M } from "@ibiz-template/model";
const R = new g(import.meta.url);
const B = y({
name: "CustomCheckboxList",
props: P(),
emits: k(),
setup(t, {
emit: r
}) {
const e = C("checkbox"), s = t.controller, n = s.model.codeList, l = O([]);
I(() => t.data, (o) => {
s.loadCodeList(o).then((a) => {
l.value = a;
});
}, {
immediate: !0,
deep: !0
});
const f = p(() => n && n.orMode ? n.orMode.toLowerCase() : "str");
let b = ",";
n && n.valueSeparator && (b = n.valueSeparator);
const m = p({
get() {
if (!j(t.value)) {
if (Object.is(f.value, "num") && l) {
const o = [], a = typeof t.value == "string" ? parseInt(t.value, 10) : t.value;
return l.value.forEach((i) => {
(a & i.value) === i.value && o.push(i.value);
}), o;
}
if (Object.is(f.value, "str")) {
const o = t.value;
if (o !== "") {
if (n) {
const a = o.split(b);
if (n.codeItemValueNumber)
for (let i = 0, c = a.length; i < c; i++)
a[i] = Number(a[i]);
return a;
}
return o.split(",");
}
}
}
return [];
},
set(o) {
let a = null;
if (Object.is(f.value, "num")) {
let i = 0;
o.forEach((c) => {
const v = typeof c == "string" ? parseInt(c, 10) : c;
i |= v;
}), a = i;
} else if (Object.is(f.value, "str")) {
const i = [];
l.value.length > 0 && (l.value.forEach((c) => {
o.findIndex((E) => Object.is(c.value, E)) !== -1 && i.push(c.value);
}), a = i.join(b));
}
r("change", a);
}
}), S = (o) => {
m.value = o;
}, x = p(() => {
const o = Array.isArray(m.value) ? m.value : [m.value];
return l.value.filter((a) => o.includes(a.value)).map((a) => a.text).join("、");
});
return {
ns: e,
items: l,
selectArray: m,
valueText: x,
onSelectArrayChange: S,
c: s
};
},
render(t) {
return t("div", {
class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
}, [[this.readonly && this.valueText, !this.readonly && t("ICheckboxGroup", {
props: {
...this.c.customProps,
value: this.selectArray
},
on: {
"on-change": this.onSelectArrayChange
}
}, [this.items.map((r, e) => t("i-checkbox", {
key: e,
attrs: {
label: r.value,
disabled: this.disabled || this.c.disabledList.includes(r.value)
}
}, [t("span", {
class: this.ns.e("text")
}, [r.text])]))])]]);
}
});
class _ extends w {
constructor() {
super(...arguments);
/**
* 默认禁用项
*
* @type {string[]}
* @memberof CustomCheckboxListController
*/
h(this, "disabledList", []);
}
async onInit() {
var e, s;
if (await super.onInit(), (e = this.editorParams) != null && e.DEFAULTDISABLEDLIST)
try {
this.disabledList = JSON.parse((s = this.editorParams) == null ? void 0 : s.DEFAULTDISABLEDLIST);
} catch (u) {
this.disabledList = [];
}
}
}
class U extends N {
constructor() {
super(...arguments);
/**
* 指定过滤参数
*
* @type {IData}
* @memberof SearchFormDynamicController
*/
h(this, "filterParams", []);
}
async onInit() {
await super.onInit();
const { FILTERPARAMS: e } = this.controlParams;
if (e)
try {
this.filterParams = JSON.parse(e);
} catch (s) {
this.filterParams = [];
}
}
/**
* 获取搜索参数
*
* @return {*} {IParams}
* @memberof SearchFormDynamicController
*/
getParams() {
const e = { ...this.data.getRequestData() };
if (this.filterParams) {
const s = {};
return this.filterParams.forEach((u) => {
Object.assign(s, { [u]: e[u] });
}), s;
}
return e;
}
/**
* 重置搜索表单
*
* @author lxm
* @date 2022-09-22 19:09:07
*/
async reset() {
const e = await this.service.getDraft(this.context, this.params);
this.filterParams.forEach((s) => {
Object.assign(this.data, { [s]: e.data[s] });
}), this.isLoaded = !0, Object.values(this.details).forEach((s) => {
this.filterParams.includes(s.model.codeName) && s.formStateNotify(T.DRAFT);
}), this.force(), await this.nerve.self.evt.asyncEmit("search");
}
}
const q = y({
name: "SearchFormDynamic",
props: {
controller: {
type: Object,
required: !0
},
modelData: {
type: M,
required: !0
},
context: {
type: Object,
required: !0
},
params: {
type: Object,
default: () => ({})
}
},
setup(t) {
const {
proxy: r
} = A(), e = F(r, () => new U(t.modelData, t.context, t.params)), s = C("search-form"), u = t.modelData.source.searchButtonStyle;
return {
c: e,
ns: s,
btntype: u
};
},
render() {
if (this.c.complete)
return d("div", {
class: [this.ns.b(), this.ns.m(this.btntype).toLowerCase()]
}, [d("form-control", {
attrs: {
"model-data": this.modelData,
context: this.context,
controller: this.c
},
nativeOn: {
keyup: (t) => this.c.onKeyUp(t)
}
}), this.c.model.source.searchButtonStyle === "NONE" ? null : d("div", {
class: this.ns.b("buttons")
}, [d("i-button", {
class: this.ns.be("buttons", "search"),
on: {
click: () => this.c.onSearchButtonClick()
}
}, ["查询"]), d("i-button", {
class: this.ns.be("buttons", "reset"),
on: {
click: () => this.c.reset()
}
}, ["重置"])])]);
}
});
class z {
constructor() {
h(this, "formEditor", "CustomCheckboxList");
h(this, "gridEditor", "CustomCheckboxList");
}
async createController(r, e) {
const s = new _(r, e);
return await s.init(), s;
}
}
class V {
constructor() {
h(this, "component", "SearchFormDynamic");
}
}
const W = {
mateUrl: import.meta.url,
install(t) {
R.loadStyle(["/style.css"]), t.component("CustomCheckboxList", B), ibiz.register.editor.register(
"EDITOR_CUSTOMSTYLE_CUSTOM_CHECKBOX_LIST",
new z()
), t.component("SearchFormDynamic", q), ibiz.register.control.register(
"SEARCHFORM_RENDER_DYNAMIC",
new V()
);
}
};
export {
W as default
};
@charset "UTF-8";.ibiz-checkbox{--ibiz-checkbox-font-size: var(--ibiz-font-size-base);--ibiz-checkbox-text-color: var(--ibiz-text-color);--ibiz-checkbox-disabled-bg-color: var(--ibiz-disabled-bg-color);--ibiz-checkbox-default-height: var(--ibiz-common-editor-size);--ibiz-checkbox-disabled-border-color: var(--ibiz-disabled-border-color)}.ibiz-checkbox .ivu-checkbox-group-item{height:var(--ibiz-checkbox-default-height);line-height:var(--ibiz-checkbox-default-height)}.ibiz-checkbox .ivu-checkbox-inner{border-color:var(--ibiz-border-color)}.ibiz-checkbox .ivu-checkbox-checked .ivu-checkbox-inner{background-color:var(--ibiz-color-primary);border-color:var(--ibiz-color-primary)}.ibiz-checkbox .ivu-checkbox-disabled .ivu-checkbox-inner{background-color:var(--ibiz-disabled-bg-color);border-color:var(--ibiz-disabled-border-color)}.ibiz-checkbox .ivu-checkbox-disabled .ivu-checkbox-inner:after{border-color:var(--ibiz-disabled-border-color)}.ibiz-checkbox .ivu-checkbox-disabled+.ibiz-checkbox__text{color:var(--ibiz-text-color-disabled)}.ibiz-checkbox .ivu-checkbox:not(.ivu-checkbox-disabled):hover .ivu-checkbox-inner{border-color:var(--ibiz-color-primary)}.ibiz-checkbox__text{font-size:var(--ibiz-checkbox-font-size);color:var(--ibiz-checkbox-text-color)}.ibiz-checkbox--readonly{color:var(--ibiz-text-color-readonly)}.ibiz-checkbox--disabled .ivu-checkbox-checked .ivu-checkbox-inner{background-color:var(--ibiz-checkbox-disabled-bg-color);border-color:var(--ibiz-checkbox-disabled-border-color)}.ibiz-search-form--user2{display:flex;flex-direction:row}.ibiz-search-form--user2 .ibiz-search-form-buttons{align-items:end;padding-top:calc(var(--ibiz-padding) / 2);padding-bottom:calc(var(--ibiz-padding) / 2)}.ibiz-search-form-buttons{--ibiz-search-form-buttons-padding: 0 16px 16px;--ibiz-search-form-buttons-btn-margin: 0 0 0 10px;--ibiz-search-form-buttons-search-btn-bg-color: var(--ibiz-color-primary);--ibiz-search-form-buttons-search-btn-bg-color-hover: #337aff;--ibiz-search-form-buttons-search-btn-color: #fff;--ibiz-search-form-buttons-default-height: var(--ibiz-common-editor-size);display:flex;align-items:center;justify-content:flex-end;padding:var(--ibiz-search-form-buttons-padding)}.ibiz-search-form-buttons__search{height:var(--ibiz-search-form-buttons-default-height);color:var(--ibiz-search-form-buttons-search-btn-color);background-color:var(--ibiz-search-form-buttons-search-btn-bg-color);border-color:var(--ibiz-color-primary);border-radius:var(--ibiz-border-radius-small)}.ibiz-search-form-buttons__search:hover{color:var(--ibiz-search-form-buttons-search-btn-color);background-color:var(--ibiz-search-form-buttons-search-btn-bg-color-hover)}.ibiz-search-form-buttons__reset{height:var(--ibiz-search-form-buttons-default-height);margin:var(--ibiz-search-form-buttons-btn-margin);border-radius:var(--ibiz-border-radius-small)}.ibiz-search-form-buttons__reset:hover{color:var(--ibiz-color-primary);border-color:var(--ibiz-color-primary)}.ibiz-search-form{--ibiz-search-form-bg-color: #fff;--ibiz-search-form-margin: 16px 0 0 24px;margin:var(--ibiz-search-form-buttons-margin);background-color:var(--ibiz-search-form-buttons-bg-color)}.ibiz-search-form .ibiz-form-page-item{padding-top:calc(var(--ibiz-padding) / 2)}.ibiz-search-form .ibiz-form-page-item-child{margin-bottom:0}.ibiz-search-form .ibiz-form-item-container{padding-right:calc(var(--ibiz-padding-right) / 2);padding-bottom:calc(var(--ibiz-padding-right) / 2)}.ibiz-search-form .ibiz-form-item-container .ibiz-form-item-container__label{color:var(--ibiz-text-color)}
{
"name": "@ibiz-template-plugin/sy-checkin-web",
"version": "0.0.1",
"description": "ibiz full-dynamic-vue 模板项目扩展插件示例",
"author": "tony001",
"license": "MIT",
"type": "module",
"main": "dist/ibiz-template-plugin.es.js",
"module": "dist/ibiz-template-plugin.es.js",
"types": "dist/types/index.d.ts",
"system": "dist/index.legacy.js",
"files": [
"dist",
"src",
"CHANGELOG.md",
"README.md"
],
"scripts": {
"dev": "vite build --watch",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"publish:next": "npm run build && npm publish --access public --tag next",
"publish:npm": "npm run build && npm publish --access public",
"publish:local": "npm run build && npm publish --access public --registry=http://172.16.240.221:8081/repository/local/"
},
"dependencies": {
"@ibiz-template/command": "^0.0.1-syui.1",
"@ibiz-template/controller": "^0.0.1-syui.18",
"@ibiz-template/core": "^0.0.1-syui.18",
"@ibiz-template/model": "^0.0.1-syui.18",
"@ibiz-template/runtime": "^0.0.1-syui.18",
"@ibiz-template/service": "^0.0.1-syui.19",
"@ibiz-template/theme": "^0.0.1-syui.18",
"@ibiz-template/vue-util": "^0.0.1-syui.18",
"async-validator": "^4.2.5",
"axios": "^1.1.3",
"core-js": "3",
"dayjs": "^1.11.6",
"lodash-es": "^4.17.21",
"pluralize": "^8.0.0",
"qs": "^6.11.0",
"qx-util": "^0.4.8",
"ramda": "^0.28.0",
"vue": "^2.7.13",
"vue-router": "^3.6.5"
},
"peerDependencies": {
"@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.59",
"@ibiz-template/core": "^0.0.1-beta.57",
"@ibiz-template/model": "^0.0.1-beta.59",
"@ibiz-template/runtime": "^0.0.1-beta.59",
"@ibiz-template/service": "^0.0.1-beta.59",
"@ibiz-template/theme": "^0.0.1-beta.59",
"@ibiz-template/vue-util": "^0.0.1-beta.59",
"async-validator": "^4.2.5",
"axios": "^1.1.3",
"core-js": "3",
"dayjs": "^1.11.6",
"lodash-es": "^4.17.21",
"pluralize": "^8.0.0",
"qs": "^6.11.0",
"qx-util": "^0.4.8",
"ramda": "^0.28.0",
"vue": "^2.7.13",
"vue-router": "^3.6.5"
},
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@qx-chitanda/vite-plugin-lib-legacy": "^4.1.0",
"@types/lodash-es": "^4.17.7",
"@types/ramda": "^0.28.20",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vitejs/plugin-legacy": "^2.3.0",
"@vitejs/plugin-vue2": "^2.2.0",
"@vitejs/plugin-vue2-jsx": "^1.1.0",
"eslint": "^8.26.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.7.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.55.0",
"stylelint": "^14.14.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recess-order": "^3.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-config-standard-scss": "^6.0.0",
"stylelint-scss": "^4.3.0",
"terser": "^5.15.1",
"typescript": "^4.8.4",
"vite": "^4.2.1",
"vite-plugin-dts": "^1.6.6",
"vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.0.9"
},
"lint-staged": {
"*.{ts,vue}": "eslint --fix",
"*.less": "stylelint --syntax=scss"
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册