From 0ecc402885f332b21923bb12183dc072306f2b39 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 21 三月 2025 18:36:15 +0800 Subject: [PATCH] vue3 --- components/oi-form/list/select/index.vue | 2 pages/selpsn/index.vue | 34 pages/modal/5601.vue | 817 ++++---- pages/modal/3037_2.vue | 334 +- pages/modal/small-wnd/line.vue | 4 api/org.js | 12 mixins/button-click.js | 20 components/oi-form/list/index.vue | 33 api/index.js | 4 components/oi-form/list/input/index.vue | 33 package.json | 2 uni_modules/select-cy/components/select-cy/select-cy.vue | 36 components/oi-form/list/checkbox/index.vue | 2 pages/login/index.vue | 25 pages/modal/small-wnd/index.vue | 16 pages/modal/classAttr.vue | 332 +- package-lock.json | 126 pages/modal/3018_2.vue | 212 - components/oi-form/list/input-number/index.vue | 35 components/oi-form/list/layout/index.vue | 24 components/oi-form/list/textarea/index.vue | 10 libs/mobox.api.js | 52 pages/modal/3200_view.vue | 53 /dev/null | 17 pages/modal/5602.vue | 457 ++-- pages/modal/ms_classAttr.vue | 688 +++--- pages/index/index.vue | 163 + App.vue | 20 components/oi-form/list/switch/index.vue | 10 pages/login/set.vue | 27 api/data.js | 16 components/oi-form/list/radio/index.vue | 2 pages/modal/form/index.vue | 146 - pages/modal/3201.vue | 51 pages/modal/3018.vue | 569 ++--- js/base64.js | 109 + api/mobox.js | 14 index.html | 15 components/oi-form/index.vue | 48 pages/selPrj/index.vue | 36 pages/modal/3037.vue | 639 +++--- What's New.txt | 5 pages/modal/3200.vue | 44 manifest.json | 7 pages/modal/5600.vue | 338 +-- main.js | 30 pages/modal/small-wnd/ext-button.vue | 2 47 files changed, 2,884 insertions(+), 2,787 deletions(-) diff --git a/App.vue b/App.vue index 9c61ef0..e88a317 100644 --- a/App.vue +++ b/App.vue @@ -22,16 +22,16 @@ this.initscan(); }, onShow: function() { - const args = plus.runtime.arguments || "" - if(args) - { - uni.showModal({ - title: "App鍙傛暟", - content: args, - showCancel: false, - confirmText:"cancel" - }); - } + // const args = plus.runtime.arguments || "" + // if(args) + // { + // uni.showModal({ + // title: "App鍙傛暟", + // content: args, + // showCancel: false, + // confirmText:"cancel" + // }); + // } console.log('App Show') }, onHide: function() { diff --git "a/What\047s New.txt" "b/What\047s New.txt" index b6850bf..5ab24dc 100644 --- "a/What\047s New.txt" +++ "b/What\047s New.txt" @@ -1,3 +1,8 @@ +2025.03.20 +1.鍗囩骇鍒皏ue3 +App 骞冲彴锛氬湪 App 骞冲彴涓婏紝Vue 3 鐨勬�鑳藉拰鍔熻兘琛ㄧ幇鑹ソ锛屼絾闇�娉ㄦ剰涓�簺鐗瑰畾鐨勯厤缃紝渚嬪鍦�nvue 涓娇鐢�Vuex銆�+楦胯挋骞冲彴锛歏ue 3 鏀寔楦胯挋骞冲彴锛屼絾 nvue 缂栬瘧鍒伴缚钂欏悗鏄潪鍘熺敓娓叉煋锛岃�鏄笌 Web 涓�牱娓叉煋 + 2025.02.19 1.action set_subtable_page_row 澶勭悊 condition 2024.08.20 diff --git a/api/data.js b/api/data.js index ff2186b..692c4fb 100644 --- a/api/data.js +++ b/api/data.js @@ -1,5 +1,7 @@ import http from '../libs/mobox.api.js'; -import Base64 from '../components/js-base64/base64.js' +import { + Base64 +} from '@/js/Base64.js'; import utils from "@/js/utils.js" /** @@ -36,7 +38,7 @@ export const getUIStyleInfo = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/class/uistyle/GetInfo?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/class/uistyle/GetInfo' return http.request({ method: "POST", header: {}, @@ -55,7 +57,7 @@ export const runCustomEvent = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/RunCustomEvent?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/RunCustomEvent' return http.request({ method: "POST", header: {}, @@ -86,7 +88,7 @@ export const dataObjQuery = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/query/Query?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/query/Query' return http.request({ method: "POST", header: {}, @@ -103,7 +105,7 @@ export const dataObjCreate = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/Create?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/Create' return http.request({ method: "POST", header: {}, @@ -143,7 +145,7 @@ export const dataObjDel = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/Delete?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/Delete' return http.request({ method: "POST", header: {}, @@ -169,7 +171,7 @@ check_compose } = data const app = getApp() - var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/GetInfo?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.data + 'api/dataobj/GetInfo' return http.request({ method: "POST", header: {}, diff --git a/api/index.js b/api/index.js index 1f064d6..30d2fdb 100644 --- a/api/index.js +++ b/api/index.js @@ -1,5 +1,7 @@ import http from '../libs/mobox.api.js'; -import Base64 from '../components/js-base64/base64.js' +import { + Base64 +} from '@/js/Base64.js'; import utils from "@/js/utils.js" import { login as loginOrg, diff --git a/api/mobox.js b/api/mobox.js index b3bcf06..fb40a63 100644 --- a/api/mobox.js +++ b/api/mobox.js @@ -1,5 +1,7 @@ import http from '../libs/mobox.api.js'; -import Base64 from '../components/js-base64/base64.js' +import { + Base64 +} from '@/js/Base64.js'; import utils from "@/js/utils.js" /** * api/app/area/GetList @@ -14,7 +16,7 @@ app_type: app_type || "MES", need_ace:need_ace||false } - var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/area/GetList?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/area/GetList' return http.request({ method: "POST", header: {}, @@ -35,7 +37,7 @@ export const getFuncTree = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/GetFuncTree?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/GetFuncTree' return http.request({ method: "POST", header: {}, @@ -54,7 +56,7 @@ export const appGetInfo = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/GetInfo?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.mobox + 'api/app/GetInfo' return http.request({ method: "POST", header: {}, @@ -74,7 +76,7 @@ export const dictGetInfo = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.mobox + 'api/dict/GetInfo2?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.mobox + 'api/dict/GetInfo2' return http.request({ method: "POST", header: {}, @@ -95,7 +97,7 @@ export const dictItemGetInfo = (data) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.mobox + 'api/dict/item/GetInfo?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.mobox + 'api/dict/item/GetInfo' return http.request({ method: "POST", header: {}, diff --git a/api/org.js b/api/org.js index 7ff0c16..f71cc67 100644 --- a/api/org.js +++ b/api/org.js @@ -1,5 +1,7 @@ import http from '../libs/mobox.api.js'; -import Base64 from '../components/js-base64/base64.js' +import { + Base64 +} from '@/js/Base64.js'; import utils from "@/js/utils.js" /** * api/user/ace/VerifyPassword @@ -38,11 +40,13 @@ export const userQuery = (query_str) => { const app = getApp() - var url = app.globalData.mobox3ApiUrl.org + 'api/user/query/query?sessionid=' + app.globalData.sessionId + var url = app.globalData.mobox3ApiUrl.org + 'api/user/query/query' return http.request({ method: "POST", header: {}, url, - data:{query_str:query_str}, + data: { + query_str: query_str + }, }) -} +} \ No newline at end of file diff --git a/components/js-base64/LICENSE.md b/components/js-base64/LICENSE.md deleted file mode 100644 index fd579a4..0000000 --- a/components/js-base64/LICENSE.md +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014, Dan Kogai -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of {{{project}}} nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/components/js-base64/README.md b/components/js-base64/README.md deleted file mode 100644 index d8c1785..0000000 --- a/components/js-base64/README.md +++ /dev/null @@ -1,169 +0,0 @@ -[](https://github.com/dankogai/js-base64/actions/workflows/node.js.yml) - -# base64.js - -Yet another [Base64] transcoder. - -[Base64]: http://en.wikipedia.org/wiki/Base64 - -## Install - -```shell -$ npm install --save js-base64 -``` - -## Usage - -### In Browser - -Locally鈥�- -```html -<script src="base64.js"></script> -``` - -鈥�or Directly from CDN. In which case you don't even need to install. - -```html -<script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.3/base64.min.js"></script> -``` - -This good old way loads `Base64` in the global context (`window`). Though `Base64.noConflict()` is made available, you should consider using ES6 Module to avoid tainting `window`. - -### As an ES6 Module - -locally鈥�- -```javascript -import { Base64 } from 'js-base64'; -``` - -```javascript -// or if you prefer no Base64 namespace -import { encode, decode } from 'js-base64'; -``` - -or even remotely. - -```html -<script type="module"> -// note jsdelivr.net does not automatically minify .mjs -import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.3/base64.mjs'; -</script> -``` - -```html -<script type="module"> -// or if you prefer no Base64 namespace -import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.3/base64.mjs'; -</script> -``` - -### node.js (commonjs) - -```javascript -const {Base64} = require('js-base64'); -``` - -Unlike the case above, the global context is no longer modified. - -You can also use [esm] to `import` instead of `require`. - -[esm]: https://github.com/standard-things/esm - -```javascript -require=require('esm')(module); -import {Base64} from 'js-base64'; -``` - -## SYNOPSIS - -```javascript -let latin = 'dankogai'; -let utf8 = '灏忛<寮� -let u8s = new Uint8Array([100,97,110,107,111,103,97,105]); -Base64.encode(latin); // ZGFua29nYWk= -Base64.encode(latin, true); // ZGFua29nYWk skips padding -Base64.encodeURI(latin); // ZGFua29nYWk -Base64.btoa(latin); // ZGFua29nYWk= -Base64.btoa(utf8); // raises exception -Base64.fromUint8Array(u8s); // ZGFua29nYWk= -Base64.fromUint8Array(u8s, true); // ZGFua29nYW which is URI safe -Base64.encode(utf8); // 5bCP6aO85by+ -Base64.encode(utf8, true) // 5bCP6aO85by- -Base64.encodeURI(utf8); // 5bCP6aO85by- -``` - -```javascript -Base64.decode( 'ZGFua29nYWk=');// dankogai -Base64.decode( 'ZGFua29nYWk'); // dankogai -Base64.atob( 'ZGFua29nYWk=');// dankogai -Base64.atob( '5bCP6aO85by+');// '氓掳聫茅拢录氓录戮' which is nonsense -Base64.toUint8Array('ZGFua29nYWk=');// u8s above -Base64.decode( '5bCP6aO85by+');// 灏忛<寮�-// note .decodeURI() is unnecessary since it accepts both flavors -Base64.decode( '5bCP6aO85by-');// 灏忛<寮�-``` - -```javascript -Base64.isValid(0); // false: 0 is not string -Base64.isValid(''); // true: a valid Base64-encoded empty byte -Base64.isValid('ZA=='); // true: a valid Base64-encoded 'd' -Base64.isValid('Z A='); // true: whitespaces are okay -Base64.isValid('ZA'); // true: padding ='s can be omitted -Base64.isValid('++'); // true: can be non URL-safe -Base64.isValid('--'); // true: or URL-safe -Base64.isValid('+-'); // false: can't mix both -``` - -### Built-in Extensions - -By default `Base64` leaves built-in prototypes untouched. But you can extend them as below. - -```javascript -// you have to explicitly extend String.prototype -Base64.extendString(); -// once extended, you can do the following -'dankogai'.toBase64(); // ZGFua29nYWk= -'灏忛<寮�.toBase64(); // 5bCP6aO85by+ -'灏忛<寮�.toBase64(true); // 5bCP6aO85by- -'灏忛<寮�.toBase64URI(); // 5bCP6aO85by- ab alias of .toBase64(true) -'灏忛<寮�.toBase64URL(); // 5bCP6aO85by- an alias of .toBase64URI() -'ZGFua29nYWk='.fromBase64(); // dankogai -'5bCP6aO85by+'.fromBase64(); // 灏忛<寮�-'5bCP6aO85by-'.fromBase64(); // 灏忛<寮�-'5bCP6aO85by-'.toUint8Array();// u8s above -``` - -```javascript -// you have to explicitly extend Uint8Array.prototype -Base64.extendUint8Array(); -// once extended, you can do the following -u8s.toBase64(); // 'ZGFua29nYWk=' -u8s.toBase64URI(); // 'ZGFua29nYWk' -u8s.toBase64URL(); // 'ZGFua29nYWk' an alias of .toBase64URI() -``` - -```javascript -// extend all at once -Base64.extendBuiltins() -``` - -## `.decode()` vs `.atob` (and `.encode()` vs `btoa()`) - -Suppose you have: - -``` -var pngBase64 = - "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; -``` - -Which is a Base64-encoded 1x1 transparent PNG, **DO NOT USE** `Base64.decode(pngBase64)`. 聽Use `Base64.atob(pngBase64)` instead. 聽`Base64.decode()` decodes to UTF-8 string while `Base64.atob()` decodes to bytes, which is compatible to browser built-in `atob()` (Which is absent in node.js). 聽The same rule applies to the opposite direction. - -Or even better, `Base64.toUint8Array(pngBase64)`. - -## Brief History - -* Since version 3.3 it is written in TypeScript. Now `base64.mjs` is compiled from `base64.ts` then `base64.js` is generated from `base64.mjs`. -* Since version 3.7 `base64.js` is ES5-compatible again (hence IE11-compatible). -* Since 3.0 `js-base64` switch to ES2015 module so it is no longer compatible with legacy browsers like IE (see above) diff --git a/components/js-base64/base64.d.ts b/components/js-base64/base64.d.ts deleted file mode 100644 index eeab94d..0000000 --- a/components/js-base64/base64.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * base64.ts - * - * Licensed under the BSD 3-Clause License. - * http://opensource.org/licenses/BSD-3-Clause - * - * References: - * http://en.wikipedia.org/wiki/Base64 - * - * @author Dan Kogai (https://github.com/dankogai) - */ -declare const version = "3.7.3"; -/** - * @deprecated use lowercase `version`. - */ -declare const VERSION = "3.7.3"; -/** - * polyfill version of `btoa` - */ -declare const btoaPolyfill: (bin: string) => string; -/** - * does what `window.btoa` of web browsers do. - * @param {String} bin binary string - * @returns {string} Base64-encoded string - */ -declare const _btoa: (bin: string) => string; -/** - * converts a Uint8Array to a Base64 string. - * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 搂5 - * @returns {string} Base64 string - */ -declare const fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string; -/** - * @deprecated should have been internal use only. - * @param {string} src UTF-8 string - * @returns {string} UTF-16 string - */ -declare const utob: (u: string) => string; -/** - * converts a UTF-8-encoded string to a Base64 string. - * @param {boolean} [urlsafe] if `true` make the result URL-safe - * @returns {string} Base64 string - */ -declare const encode: (src: string, urlsafe?: boolean) => string; -/** - * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 搂5. - * @returns {string} Base64 string - */ -declare const encodeURI: (src: string) => string; -/** - * @deprecated should have been internal use only. - * @param {string} src UTF-16 string - * @returns {string} UTF-8 string - */ -declare const btou: (b: string) => string; -/** - * polyfill version of `atob` - */ -declare const atobPolyfill: (asc: string) => string; -/** - * does what `window.atob` of web browsers do. - * @param {String} asc Base64-encoded string - * @returns {string} binary string - */ -declare const _atob: (asc: string) => string; -/** - * converts a Base64 string to a Uint8Array. - */ -declare const toUint8Array: (a: string) => Uint8Array; -/** - * converts a Base64 string to a UTF-8 string. - * @param {String} src Base64 string. Both normal and URL-safe are supported - * @returns {string} UTF-8 string - */ -declare const decode: (src: string) => string; -/** - * check if a value is a valid Base64 string - * @param {String} src a value to check - */ -declare const isValid: (src: any) => boolean; -/** - * extend String.prototype with relevant methods - */ -declare const extendString: () => void; -/** - * extend Uint8Array.prototype with relevant methods - */ -declare const extendUint8Array: () => void; -/** - * extend Builtin prototypes with relevant methods - */ -declare const extendBuiltins: () => void; -declare const gBase64: { - version: string; - VERSION: string; - atob: (asc: string) => string; - atobPolyfill: (asc: string) => string; - btoa: (bin: string) => string; - btoaPolyfill: (bin: string) => string; - fromBase64: (src: string) => string; - toBase64: (src: string, urlsafe?: boolean) => string; - encode: (src: string, urlsafe?: boolean) => string; - encodeURI: (src: string) => string; - encodeURL: (src: string) => string; - utob: (u: string) => string; - btou: (b: string) => string; - decode: (src: string) => string; - isValid: (src: any) => boolean; - fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string; - toUint8Array: (a: string) => Uint8Array; - extendString: () => void; - extendUint8Array: () => void; - extendBuiltins: () => void; -}; -export { version }; -export { VERSION }; -export { _atob as atob }; -export { atobPolyfill }; -export { _btoa as btoa }; -export { btoaPolyfill }; -export { decode as fromBase64 }; -export { encode as toBase64 }; -export { utob }; -export { encode }; -export { encodeURI }; -export { encodeURI as encodeURL }; -export { btou }; -export { decode }; -export { isValid }; -export { fromUint8Array }; -export { toUint8Array }; -export { extendString }; -export { extendUint8Array }; -export { extendBuiltins }; -export { gBase64 as Base64 }; diff --git a/components/js-base64/base64.js b/components/js-base64/base64.js deleted file mode 100644 index 0253235..0000000 --- a/components/js-base64/base64.js +++ /dev/null @@ -1,319 +0,0 @@ -// -// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND! -// -; -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - ? module.exports = factory() - : typeof define === 'function' && define.amd - ? define(factory) : - // cf. https://github.com/dankogai/js-base64/issues/119 - (function () { - // existing version for noConflict() - var _Base64 = global.Base64; - var gBase64 = factory(); - gBase64.noConflict = function () { - global.Base64 = _Base64; - return gBase64; - }; - if (global.Meteor) { // Meteor.js - Base64 = gBase64; - } - global.Base64 = gBase64; - })(); -}((typeof self !== 'undefined' ? self - : typeof window !== 'undefined' ? window - : typeof global !== 'undefined' ? global - : this), function () { - 'use strict'; - /** - * base64.ts - * - * Licensed under the BSD 3-Clause License. - * http://opensource.org/licenses/BSD-3-Clause - * - * References: - * http://en.wikipedia.org/wiki/Base64 - * - * @author Dan Kogai (https://github.com/dankogai) - */ - var version = '3.7.3'; - /** - * @deprecated use lowercase `version`. - */ - var VERSION = version; - var _hasatob = typeof atob === 'function'; - var _hasbtoa = typeof btoa === 'function'; - var _hasBuffer = typeof Buffer === 'function'; - var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined; - var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined; - var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - var b64chs = Array.prototype.slice.call(b64ch); - var b64tab = (function (a) { - var tab = {}; - a.forEach(function (c, i) { return tab[c] = i; }); - return tab; - })(b64chs); - var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/; - var _fromCC = String.fromCharCode.bind(String); - var _U8Afrom = typeof Uint8Array.from === 'function' - ? Uint8Array.from.bind(Uint8Array) - : function (it, fn) { - if (fn === void 0) { fn = function (x) { return x; }; } - return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn)); - }; - var _mkUriSafe = function (src) { return src - .replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); }; - var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); }; - /** - * polyfill version of `btoa` - */ - var btoaPolyfill = function (bin) { - // console.log('polyfilled'); - var u32, c0, c1, c2, asc = ''; - var pad = bin.length % 3; - for (var i = 0; i < bin.length;) { - if ((c0 = bin.charCodeAt(i++)) > 255 || - (c1 = bin.charCodeAt(i++)) > 255 || - (c2 = bin.charCodeAt(i++)) > 255) - throw new TypeError('invalid character found'); - u32 = (c0 << 16) | (c1 << 8) | c2; - asc += b64chs[u32 >> 18 & 63] - + b64chs[u32 >> 12 & 63] - + b64chs[u32 >> 6 & 63] - + b64chs[u32 & 63]; - } - return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc; - }; - /** - * does what `window.btoa` of web browsers do. - * @param {String} bin binary string - * @returns {string} Base64-encoded string - */ - var _btoa = _hasbtoa ? function (bin) { return btoa(bin); } - : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); } - : btoaPolyfill; - var _fromUint8Array = _hasBuffer - ? function (u8a) { return Buffer.from(u8a).toString('base64'); } - : function (u8a) { - // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326 - var maxargs = 0x1000; - var strs = []; - for (var i = 0, l = u8a.length; i < l; i += maxargs) { - strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs))); - } - return _btoa(strs.join('')); - }; - /** - * converts a Uint8Array to a Base64 string. - * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 搂5 - * @returns {string} Base64 string - */ - var fromUint8Array = function (u8a, urlsafe) { - if (urlsafe === void 0) { urlsafe = false; } - return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a); - }; - // This trick is found broken https://github.com/dankogai/js-base64/issues/130 - // const utob = (src: string) => unescape(encodeURIComponent(src)); - // reverting good old fationed regexp - var cb_utob = function (c) { - if (c.length < 2) { - var cc = c.charCodeAt(0); - return cc < 0x80 ? c - : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6)) - + _fromCC(0x80 | (cc & 0x3f))) - : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f)) - + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) - + _fromCC(0x80 | (cc & 0x3f))); - } - else { - var cc = 0x10000 - + (c.charCodeAt(0) - 0xD800) * 0x400 - + (c.charCodeAt(1) - 0xDC00); - return (_fromCC(0xf0 | ((cc >>> 18) & 0x07)) - + _fromCC(0x80 | ((cc >>> 12) & 0x3f)) - + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) - + _fromCC(0x80 | (cc & 0x3f))); - } - }; - var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; - /** - * @deprecated should have been internal use only. - * @param {string} src UTF-8 string - * @returns {string} UTF-16 string - */ - var utob = function (u) { return u.replace(re_utob, cb_utob); }; - // - var _encode = _hasBuffer - ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); } - : _TE - ? function (s) { return _fromUint8Array(_TE.encode(s)); } - : function (s) { return _btoa(utob(s)); }; - /** - * converts a UTF-8-encoded string to a Base64 string. - * @param {boolean} [urlsafe] if `true` make the result URL-safe - * @returns {string} Base64 string - */ - var encode = function (src, urlsafe) { - if (urlsafe === void 0) { urlsafe = false; } - return urlsafe - ? _mkUriSafe(_encode(src)) - : _encode(src); - }; - /** - * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 搂5. - * @returns {string} Base64 string - */ - var encodeURI = function (src) { return encode(src, true); }; - // This trick is found broken https://github.com/dankogai/js-base64/issues/130 - // const btou = (src: string) => decodeURIComponent(escape(src)); - // reverting good old fationed regexp - var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g; - var cb_btou = function (cccc) { - switch (cccc.length) { - case 4: - var cp = ((0x07 & cccc.charCodeAt(0)) << 18) - | ((0x3f & cccc.charCodeAt(1)) << 12) - | ((0x3f & cccc.charCodeAt(2)) << 6) - | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000; - return (_fromCC((offset >>> 10) + 0xD800) - + _fromCC((offset & 0x3FF) + 0xDC00)); - case 3: - return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12) - | ((0x3f & cccc.charCodeAt(1)) << 6) - | (0x3f & cccc.charCodeAt(2))); - default: - return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6) - | (0x3f & cccc.charCodeAt(1))); - } - }; - /** - * @deprecated should have been internal use only. - * @param {string} src UTF-16 string - * @returns {string} UTF-8 string - */ - var btou = function (b) { return b.replace(re_btou, cb_btou); }; - /** - * polyfill version of `atob` - */ - var atobPolyfill = function (asc) { - // console.log('polyfilled'); - asc = asc.replace(/\s+/g, ''); - if (!b64re.test(asc)) - throw new TypeError('malformed base64.'); - asc += '=='.slice(2 - (asc.length & 3)); - var u24, bin = '', r1, r2; - for (var i = 0; i < asc.length;) { - u24 = b64tab[asc.charAt(i++)] << 18 - | b64tab[asc.charAt(i++)] << 12 - | (r1 = b64tab[asc.charAt(i++)]) << 6 - | (r2 = b64tab[asc.charAt(i++)]); - bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) - : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) - : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255); - } - return bin; - }; - /** - * does what `window.atob` of web browsers do. - * @param {String} asc Base64-encoded string - * @returns {string} binary string - */ - var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); } - : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); } - : atobPolyfill; - // - var _toUint8Array = _hasBuffer - ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); } - : function (a) { return _U8Afrom(_atob(a), function (c) { return c.charCodeAt(0); }); }; - /** - * converts a Base64 string to a Uint8Array. - */ - var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); }; - // - var _decode = _hasBuffer - ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); } - : _TD - ? function (a) { return _TD.decode(_toUint8Array(a)); } - : function (a) { return btou(_atob(a)); }; - var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); }; - /** - * converts a Base64 string to a UTF-8 string. - * @param {String} src Base64 string. Both normal and URL-safe are supported - * @returns {string} UTF-8 string - */ - var decode = function (src) { return _decode(_unURI(src)); }; - /** - * check if a value is a valid Base64 string - * @param {String} src a value to check - */ - var isValid = function (src) { - if (typeof src !== 'string') - return false; - var s = src.replace(/\s+/g, '').replace(/={0,2}$/, ''); - return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s); - }; - // - var _noEnum = function (v) { - return { - value: v, enumerable: false, writable: true, configurable: true - }; - }; - /** - * extend String.prototype with relevant methods - */ - var extendString = function () { - var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); }; - _add('fromBase64', function () { return decode(this); }); - _add('toBase64', function (urlsafe) { return encode(this, urlsafe); }); - _add('toBase64URI', function () { return encode(this, true); }); - _add('toBase64URL', function () { return encode(this, true); }); - _add('toUint8Array', function () { return toUint8Array(this); }); - }; - /** - * extend Uint8Array.prototype with relevant methods - */ - var extendUint8Array = function () { - var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); }; - _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); }); - _add('toBase64URI', function () { return fromUint8Array(this, true); }); - _add('toBase64URL', function () { return fromUint8Array(this, true); }); - }; - /** - * extend Builtin prototypes with relevant methods - */ - var extendBuiltins = function () { - extendString(); - extendUint8Array(); - }; - var gBase64 = { - version: version, - VERSION: VERSION, - atob: _atob, - atobPolyfill: atobPolyfill, - btoa: _btoa, - btoaPolyfill: btoaPolyfill, - fromBase64: decode, - toBase64: encode, - encode: encode, - encodeURI: encodeURI, - encodeURL: encodeURI, - utob: utob, - btou: btou, - decode: decode, - isValid: isValid, - fromUint8Array: fromUint8Array, - toUint8Array: toUint8Array, - extendString: extendString, - extendUint8Array: extendUint8Array, - extendBuiltins: extendBuiltins - }; - // - // export Base64 to the namespace - // - // ES5 is yet to have Object.assign() that may make transpilers unhappy. - // gBase64.Base64 = Object.assign({}, gBase64); - gBase64.Base64 = {}; - Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; }); - return gBase64; -})); diff --git a/components/js-base64/base64.mjs b/components/js-base64/base64.mjs deleted file mode 100644 index cf66196..0000000 --- a/components/js-base64/base64.mjs +++ /dev/null @@ -1,296 +0,0 @@ -/** - * base64.ts - * - * Licensed under the BSD 3-Clause License. - * http://opensource.org/licenses/BSD-3-Clause - * - * References: - * http://en.wikipedia.org/wiki/Base64 - * - * @author Dan Kogai (https://github.com/dankogai) - */ -const version = '3.7.3'; -/** - * @deprecated use lowercase `version`. - */ -const VERSION = version; -const _hasatob = typeof atob === 'function'; -const _hasbtoa = typeof btoa === 'function'; -const _hasBuffer = typeof Buffer === 'function'; -const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined; -const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined; -const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; -const b64chs = Array.prototype.slice.call(b64ch); -const b64tab = ((a) => { - let tab = {}; - a.forEach((c, i) => tab[c] = i); - return tab; -})(b64chs); -const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/; -const _fromCC = String.fromCharCode.bind(String); -const _U8Afrom = typeof Uint8Array.from === 'function' - ? Uint8Array.from.bind(Uint8Array) - : (it, fn = (x) => x) => new Uint8Array(Array.prototype.slice.call(it, 0).map(fn)); -const _mkUriSafe = (src) => src - .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_'); -const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, ''); -/** - * polyfill version of `btoa` - */ -const btoaPolyfill = (bin) => { - // console.log('polyfilled'); - let u32, c0, c1, c2, asc = ''; - const pad = bin.length % 3; - for (let i = 0; i < bin.length;) { - if ((c0 = bin.charCodeAt(i++)) > 255 || - (c1 = bin.charCodeAt(i++)) > 255 || - (c2 = bin.charCodeAt(i++)) > 255) - throw new TypeError('invalid character found'); - u32 = (c0 << 16) | (c1 << 8) | c2; - asc += b64chs[u32 >> 18 & 63] - + b64chs[u32 >> 12 & 63] - + b64chs[u32 >> 6 & 63] - + b64chs[u32 & 63]; - } - return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc; -}; -/** - * does what `window.btoa` of web browsers do. - * @param {String} bin binary string - * @returns {string} Base64-encoded string - */ -const _btoa = _hasbtoa ? (bin) => btoa(bin) - : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64') - : btoaPolyfill; -const _fromUint8Array = _hasBuffer - ? (u8a) => Buffer.from(u8a).toString('base64') - : (u8a) => { - // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326 - const maxargs = 0x1000; - let strs = []; - for (let i = 0, l = u8a.length; i < l; i += maxargs) { - strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs))); - } - return _btoa(strs.join('')); - }; -/** - * converts a Uint8Array to a Base64 string. - * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 搂5 - * @returns {string} Base64 string - */ -const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a); -// This trick is found broken https://github.com/dankogai/js-base64/issues/130 -// const utob = (src: string) => unescape(encodeURIComponent(src)); -// reverting good old fationed regexp -const cb_utob = (c) => { - if (c.length < 2) { - var cc = c.charCodeAt(0); - return cc < 0x80 ? c - : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6)) - + _fromCC(0x80 | (cc & 0x3f))) - : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f)) - + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) - + _fromCC(0x80 | (cc & 0x3f))); - } - else { - var cc = 0x10000 - + (c.charCodeAt(0) - 0xD800) * 0x400 - + (c.charCodeAt(1) - 0xDC00); - return (_fromCC(0xf0 | ((cc >>> 18) & 0x07)) - + _fromCC(0x80 | ((cc >>> 12) & 0x3f)) - + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) - + _fromCC(0x80 | (cc & 0x3f))); - } -}; -const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; -/** - * @deprecated should have been internal use only. - * @param {string} src UTF-8 string - * @returns {string} UTF-16 string - */ -const utob = (u) => u.replace(re_utob, cb_utob); -// -const _encode = _hasBuffer - ? (s) => Buffer.from(s, 'utf8').toString('base64') - : _TE - ? (s) => _fromUint8Array(_TE.encode(s)) - : (s) => _btoa(utob(s)); -/** - * converts a UTF-8-encoded string to a Base64 string. - * @param {boolean} [urlsafe] if `true` make the result URL-safe - * @returns {string} Base64 string - */ -const encode = (src, urlsafe = false) => urlsafe - ? _mkUriSafe(_encode(src)) - : _encode(src); -/** - * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 搂5. - * @returns {string} Base64 string - */ -const encodeURI = (src) => encode(src, true); -// This trick is found broken https://github.com/dankogai/js-base64/issues/130 -// const btou = (src: string) => decodeURIComponent(escape(src)); -// reverting good old fationed regexp -const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g; -const cb_btou = (cccc) => { - switch (cccc.length) { - case 4: - var cp = ((0x07 & cccc.charCodeAt(0)) << 18) - | ((0x3f & cccc.charCodeAt(1)) << 12) - | ((0x3f & cccc.charCodeAt(2)) << 6) - | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000; - return (_fromCC((offset >>> 10) + 0xD800) - + _fromCC((offset & 0x3FF) + 0xDC00)); - case 3: - return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12) - | ((0x3f & cccc.charCodeAt(1)) << 6) - | (0x3f & cccc.charCodeAt(2))); - default: - return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6) - | (0x3f & cccc.charCodeAt(1))); - } -}; -/** - * @deprecated should have been internal use only. - * @param {string} src UTF-16 string - * @returns {string} UTF-8 string - */ -const btou = (b) => b.replace(re_btou, cb_btou); -/** - * polyfill version of `atob` - */ -const atobPolyfill = (asc) => { - // console.log('polyfilled'); - asc = asc.replace(/\s+/g, ''); - if (!b64re.test(asc)) - throw new TypeError('malformed base64.'); - asc += '=='.slice(2 - (asc.length & 3)); - let u24, bin = '', r1, r2; - for (let i = 0; i < asc.length;) { - u24 = b64tab[asc.charAt(i++)] << 18 - | b64tab[asc.charAt(i++)] << 12 - | (r1 = b64tab[asc.charAt(i++)]) << 6 - | (r2 = b64tab[asc.charAt(i++)]); - bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) - : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) - : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255); - } - return bin; -}; -/** - * does what `window.atob` of web browsers do. - * @param {String} asc Base64-encoded string - * @returns {string} binary string - */ -const _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) - : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary') - : atobPolyfill; -// -const _toUint8Array = _hasBuffer - ? (a) => _U8Afrom(Buffer.from(a, 'base64')) - : (a) => _U8Afrom(_atob(a), c => c.charCodeAt(0)); -/** - * converts a Base64 string to a Uint8Array. - */ -const toUint8Array = (a) => _toUint8Array(_unURI(a)); -// -const _decode = _hasBuffer - ? (a) => Buffer.from(a, 'base64').toString('utf8') - : _TD - ? (a) => _TD.decode(_toUint8Array(a)) - : (a) => btou(_atob(a)); -const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/')); -/** - * converts a Base64 string to a UTF-8 string. - * @param {String} src Base64 string. Both normal and URL-safe are supported - * @returns {string} UTF-8 string - */ -const decode = (src) => _decode(_unURI(src)); -/** - * check if a value is a valid Base64 string - * @param {String} src a value to check - */ -const isValid = (src) => { - if (typeof src !== 'string') - return false; - const s = src.replace(/\s+/g, '').replace(/={0,2}$/, ''); - return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s); -}; -// -const _noEnum = (v) => { - return { - value: v, enumerable: false, writable: true, configurable: true - }; -}; -/** - * extend String.prototype with relevant methods - */ -const extendString = function () { - const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body)); - _add('fromBase64', function () { return decode(this); }); - _add('toBase64', function (urlsafe) { return encode(this, urlsafe); }); - _add('toBase64URI', function () { return encode(this, true); }); - _add('toBase64URL', function () { return encode(this, true); }); - _add('toUint8Array', function () { return toUint8Array(this); }); -}; -/** - * extend Uint8Array.prototype with relevant methods - */ -const extendUint8Array = function () { - const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); - _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); }); - _add('toBase64URI', function () { return fromUint8Array(this, true); }); - _add('toBase64URL', function () { return fromUint8Array(this, true); }); -}; -/** - * extend Builtin prototypes with relevant methods - */ -const extendBuiltins = () => { - extendString(); - extendUint8Array(); -}; -const gBase64 = { - version: version, - VERSION: VERSION, - atob: _atob, - atobPolyfill: atobPolyfill, - btoa: _btoa, - btoaPolyfill: btoaPolyfill, - fromBase64: decode, - toBase64: encode, - encode: encode, - encodeURI: encodeURI, - encodeURL: encodeURI, - utob: utob, - btou: btou, - decode: decode, - isValid: isValid, - fromUint8Array: fromUint8Array, - toUint8Array: toUint8Array, - extendString: extendString, - extendUint8Array: extendUint8Array, - extendBuiltins: extendBuiltins, -}; -// makecjs:CUT // -export { version }; -export { VERSION }; -export { _atob as atob }; -export { atobPolyfill }; -export { _btoa as btoa }; -export { btoaPolyfill }; -export { decode as fromBase64 }; -export { encode as toBase64 }; -export { utob }; -export { encode }; -export { encodeURI }; -export { encodeURI as encodeURL }; -export { btou }; -export { decode }; -export { isValid }; -export { fromUint8Array }; -export { toUint8Array }; -export { extendString }; -export { extendUint8Array }; -export { extendBuiltins }; -// and finally, -export { gBase64 as Base64 }; diff --git a/components/js-base64/package.json b/components/js-base64/package.json deleted file mode 100644 index 790c9a2..0000000 --- a/components/js-base64/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "js-base64", - "version": "3.7.3", - "description": "Yet another Base64 transcoder in pure-JS", - "main": "base64.js", - "module": "base64.mjs", - "types": "base64.d.ts", - "files": [ - "base64.js", - "base64.mjs", - "base64.d.ts" - ], - "exports": { - ".": { - "types": "./base64.d.ts", - "import": "./base64.mjs", - "require": "./base64.js" - }, - "./package.json": "./package.json" - }, - "scripts": { - "test": "make clean && make test" - }, - "devDependencies": { - "@types/node": "^14.0.26", - "esm": "^3.2.25", - "mocha": "^8.4.0", - "typescript": "^3.9.7" - }, - "repository": "git+https://github.com/dankogai/js-base64.git", - "keywords": [ - "base64", - "binary" - ], - "author": "Dan Kogai", - "license": "BSD-3-Clause" -} diff --git a/components/oi-form/index.vue b/components/oi-form/index.vue index fd8bbc0..5de15fd 100644 --- a/components/oi-form/index.vue +++ b/components/oi-form/index.vue @@ -1,27 +1,32 @@ <template> <uni-forms class="oi-form" ref="baseForm" label-align="right"> - <template v-for="(item,index) in form.items"> - <OIFormLayout v-if="item.name == 'Layout'" v-show="!item.isHidden" :focusId="focusId" :viewMode="viewMode" - :hiddenIds="hiddenIds" :data="item" @change="onChange" @focus="onFocus" @click="onClick" - @click-prefix="onClickPrefix" @click-suffix="onClickSuffix"> - </OIFormLayout> + <view v-for="(item,index) in form.items" :key="index"> + <!-- 鏍呮牸甯冨眬 --> + <uni-row v-if="item.name == 'Layout'" v-show="!item.isHidden" :gutter="item.setting.gutter"> + <uni-col + :span="item.setting.spanList && item.setting.spanList[key]? item.setting.spanList[key] : 24 / item.setting.col" + v-for="(col,key) in item.setting.colList" :key="key"> + <OIFormItem v-if="col != null" :focusId="focusId" :viewMode="viewMode" :data="col" + :hiddenIds="hiddenIds" @on-change="onChange" @on-focus="onFocus" @on-click="onClick" + @on-click-prefix="onClickPrefix" @on-click-suffix="onClickSuffix"></OIFormItem> + <uni-forms-item v-else label=""></uni-forms-item> + </uni-col> + </uni-row> <OIFormItem v-else :hiddenIds="hiddenIds" :focusId="focusId" :viewMode="viewMode" :data="item" - @change="onChange" @focus="onFocus" @click="onClick" @click-prefix="onClickPrefix" - @click-suffix="onClickSuffix"> + @on-change="onChange" @on-focus="onFocus" @on-click="onClick" @on-click-prefix="onClickPrefix" + @on-click-suffix="onClickSuffix"> </OIFormItem> - </template> + </view> </uni-forms> </template> <script> import OIFormItem from './list/index.vue' - import OIFormLayout from './list/layout/index.vue' export default { name: "OIForm", components: { OIFormItem, - OIFormLayout }, props: { form: { @@ -73,27 +78,30 @@ onChange(item) { var attr = item.fieldId; this.form.model[attr] = item.value; - this.$emit("change", item) + this.$emit("on-change", item) }, onClick(item) { - this.$emit("click", item) + this.$emit("on-click", item) }, onFocus(item) { - this.$emit("focus", item) + this.$emit("on-focus", item) }, onClickPrefix(item) { - this.$emit("click-prefix", item) + this.$emit("on-click-prefix", item) }, onClickSuffix(item) { - this.$emit("click-suffix", item) + this.$emit("on-click-suffix", item) }, - } + }, + // beforeUpdate() { + // console.log("beforeUpdate form", this.form) + // }, + // updated() { + // console.log("updated form", this.form) + // } }; </script> <style lang="less"> - .oi-form { - - - } + .oi-form {} </style> \ No newline at end of file diff --git a/components/oi-form/list/checkbox/index.vue b/components/oi-form/list/checkbox/index.vue index 905c4c0..bff91b9 100644 --- a/components/oi-form/list/checkbox/index.vue +++ b/components/oi-form/list/checkbox/index.vue @@ -34,7 +34,7 @@ this.model[this.data.fieldId] = val } this.data.value = val - this.$emit("change", val) + this.$emit("on-change", val) }, } diff --git a/components/oi-form/list/index.vue b/components/oi-form/list/index.vue index c3abb35..93d8c1f 100644 --- a/components/oi-form/list/index.vue +++ b/components/oi-form/list/index.vue @@ -7,26 +7,26 @@ <OIFormText v-if="viewMode && data.disabled" :data="data" :model="model"> </OIFormText> <OIFormInput v-else-if="data.name == 'Input'" :viewMode="viewMode" :focus="focusId== data.fieldId" - :data="data" :model="model" @change="onChange" @focus="onFocus" @click="onClick" - @click-prefix="onClickPrefix" @click-suffix="onClickSuffix"> + :data="data" :model="model" @on-change="onChange" @on-focus="onFocus" @on-click="onClick" + @on-click-prefix="onClickPrefix" @on-click-suffix="onClickSuffix"> </OIFormInput> <OIFormInputNumber v-else-if="data.name == 'InputNumber'" :focus="focusId== data.fieldId" :data="data" - :model="model" @change="onChange" @focus="onFocus" @click="onClick"> + :model="model" @on-change="onChange" @on-focus="onFocus" @on-click="onClick"> </OIFormInputNumber> <OIFormTextArea v-else-if="data.name == 'Textarea'" :focus="focusId== data.fieldId" :data="data" - :model="model" @change="onChange" @focus="onFocus" @click="onClick"> + :model="model" @on-change="onChange" @on-focus="onFocus" @on-click="onClick"> </OIFormTextArea> - <OIFormSelect v-else-if="data.name == 'Select'" :data="data" :model="model" @change="onChange"> + <OIFormSelect v-else-if="data.name == 'Select'" :data="data" :model="model" @on-change="onChange"> </OIFormSelect> - <OIFormSwitch v-else-if="data.name == 'Switch'" :data="data" :model="model" @change="onChange"> + <OIFormSwitch v-else-if="data.name == 'Switch'" :data="data" :model="model" @on-change="onChange"> </OIFormSwitch> - <OIFormCheckbox v-else-if="data.name == 'Checkbox'" :data="data" :model="model" @change="onChange"> + <OIFormCheckbox v-else-if="data.name == 'Checkbox'" :data="data" :model="model" @on-change="onChange"> </OIFormCheckbox> - <OIFormRadio v-else-if="data.name == 'Radio'" :data="data" :model="model" @change="onChange"> + <OIFormRadio v-else-if="data.name == 'Radio'" :data="data" :model="model" @on-change="onChange"> </OIFormRadio> - <OIFormDatePicker v-else-if="data.name == 'DatePicker'" :data="data" :model="model" @change="onChange"> + <OIFormDatePicker v-else-if="data.name == 'DatePicker'" :data="data" :model="model" @on-change="onChange"> </OIFormDatePicker> - <OIFormTimePicker v-else-if="data.name == 'TimePicker'" :data="data" :model="model" @change="onChange"> + <OIFormTimePicker v-else-if="data.name == 'TimePicker'" :data="data" :model="model" @on-change="onChange"> </OIFormTimePicker> <OIFormDatePickerRange v-else-if="data.name == 'DatePickerRange'" :data="data" :model="model" @change="onChange"> @@ -87,24 +87,21 @@ }, methods: { onChange(e) { - this.$emit("change", this.data) + this.$emit("on-change", this.data) }, onClick(e) { - this.$emit("click", this.data) + this.$emit("on-click", this.data) }, onFocus(e) { - this.$emit("focus", this.data) + this.$emit("on-focus", this.data) }, onClickPrefix() { - this.$emit("click-prefix", this.data) + this.$emit("on-click-prefix", this.data) }, onClickSuffix() { - this.$emit("click-suffix", this.data) + this.$emit("on-click-suffix", this.data) }, }, - mounted() { - console.log("item", this.data) - } }; </script> diff --git a/components/oi-form/list/input-number/index.vue b/components/oi-form/list/input-number/index.vue index 0063d6d..c2c3cbf 100644 --- a/components/oi-form/list/input-number/index.vue +++ b/components/oi-form/list/input-number/index.vue @@ -1,10 +1,10 @@ <template> <view class="oi-form-input-number"> - <input v-if="model" type="number" class="oi-input-number" :class="data.disabled?'input-disabled':''" v-model="model[data.fieldId]" :focus="focus" + <input v-if="model" type="number" class="oi-input-number" :class="data.disabled?'input-disabled':''" v-model="model[data.fieldId]" :focus="focus" :placeholder="data.placeholder" @blur="onChange" @confirm="onConfirm" @click="onClick" :disabled="data.disabled"></input> - <input v-else type="number" class="oi-input-number" :class="data.disabled?'input-disabled':''" v-model="data.value" :focus="focus" - :placeholder="data.placeholder" @blur="onChange" @confirm="onConfirm" @click="onClick" + <input v-else type="number" class="oi-input-number" :class="data.disabled?'input-disabled':''" v-model="data.value" + :focus="focus" :placeholder="data.placeholder" @blur="onChange" @confirm="onConfirm" @click="onClick" :disabled="data.disabled"></input> </view> </template> @@ -25,25 +25,31 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.$emit("on-change", e) }, onConfirm(e) { this.onChange(e) }, onClick(e) { - this.$emit("click", e) + this.$emit("on-click", e) }, - - } + + }, + watch: { + data: { + handler(newVal) { + console.log("watch input-number", newVal) + }, + deep: true, // 娣卞害鐩戝惉 + }, + }, }; </script> <style lang="less" scoped> .oi-form-input-number { - border: 1px solid #d5d5d5; - width: calc(100%- 6rpx); - border-radius: 6px !important; - padding: 3rpx; + width: 100%; + .input-disabled { background-color: #f3f3f3 !important; } @@ -65,8 +71,9 @@ transition-duration: 0.1s; vertical-align: middle; } - } - .oi-form-input-number:hover { - border: 1px solid rgb(41, 121, 255); + + .oi-input-number:hover { + border: 1px solid rgb(41, 121, 255); + } } </style> \ No newline at end of file diff --git a/components/oi-form/list/input/index.vue b/components/oi-form/list/input/index.vue index a0ec6f0..c212abe 100644 --- a/components/oi-form/list/input/index.vue +++ b/components/oi-form/list/input/index.vue @@ -17,8 +17,12 @@ </template> <script> + import buttonClickMixin from '@/mixins/button-click.js'; + export default { + name: "OIFormInput", + mixins: [buttonClickMixin], props: { viewMode: { type: Boolean, @@ -36,24 +40,39 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.$emit("on-change", e) }, onConfirm(e) { + console.log("onConfirm") this.onChange(e) }, onClick(e) { this.$emit("click", e) }, onFocus(e) { - this.$emit("focus", e) + this.$emit("on-focus", e) }, onPrefixButton() { - this.$emit("click-prefix") + this.handleButtonClick((done) => { + this.$emit("on-click-prefix") + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); }, onSuffixButton() { - this.$emit("click-suffix") + + this.handleButtonClick((done) => { + this.$emit("on-click-suffix") + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + + }, - } + }, + }; </script> @@ -62,10 +81,10 @@ border: 1px solid #d5d5d5; border-radius: 6px !important; padding: 3rpx; - width: calc(100%- 6rpx); + width: calc(100% - 6rpx); display: flex; flex-direction: row; - + .input-disabled { background-color: #f3f3f3 !important; } diff --git a/components/oi-form/list/layout/index.vue b/components/oi-form/list/layout/index.vue index 6c4bec0..9bedb6c 100644 --- a/components/oi-form/list/layout/index.vue +++ b/components/oi-form/list/layout/index.vue @@ -3,10 +3,10 @@ <uni-row :gutter="data.setting.gutter"> <uni-col :span="data.setting.spanList && data.setting.spanList[key]? data.setting.spanList[key] : 24 / data.setting.col" - v-for="(col,key) in data.setting.colList"> + v-for="(col,key) in data.setting.colList" :key="key"> <OIFormItem v-if="col != null" :focusId="focusId" :viewMode="viewMode" :data="col" :model="model" - :hiddenIds="hiddenIds" @change="onChange" @focus="onFocus" @click="onClick" - @click-prefix="onClickPrefix" @click-suffix="onClickSuffix"></OIFormItem> + :hiddenIds="hiddenIds" @on-change="onChange" @on-focus="onFocus" @on-click="onClick" + @on-click-prefix="onClickPrefix" @on-click-suffix="onClickSuffix"></OIFormItem> <uni-forms-item v-else label=""></uni-forms-item> </uni-col> </uni-row> @@ -41,25 +41,31 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.$emit("on-change", e) }, onClick(e) { - this.$emit("click", e) + this.$emit("on-click", e) }, onFocus(e) { - this.$emit("focus", e) + this.$emit("on-focus", e) }, onClickPrefix(e) { - this.$emit("click-prefix", e) + this.$emit("on-click-prefix", e) }, onClickSuffix(e) { - this.$emit("click-suffix", e) + this.$emit("on-click-suffix", e) }, }, mounted() { - console.log("layout", this.data.setting.colList) + console.log("mounted layout", this.data.setting.colList) }, + beforeUpdate (){ + console.log("beforeUpdate layout",this.data) + }, + updated(){ + console.log("updated layout",this.data) + } }; </script> diff --git a/components/oi-form/list/radio/index.vue b/components/oi-form/list/radio/index.vue index 236418f..dea44c1 100644 --- a/components/oi-form/list/radio/index.vue +++ b/components/oi-form/list/radio/index.vue @@ -34,7 +34,7 @@ this.model[this.data.fieldId] = val } this.data.value = val - this.$emit("change", val) + this.$emit("on-change", val) }, } diff --git a/components/oi-form/list/select/index.vue b/components/oi-form/list/select/index.vue index accc501..8dd294c 100644 --- a/components/oi-form/list/select/index.vue +++ b/components/oi-form/list/select/index.vue @@ -22,7 +22,7 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.$emit("on-change", e) }, } diff --git a/components/oi-form/list/switch/index.vue b/components/oi-form/list/switch/index.vue index 61be119..45adb7f 100644 --- a/components/oi-form/list/switch/index.vue +++ b/components/oi-form/list/switch/index.vue @@ -2,8 +2,8 @@ <view class="oi-form-switch"> <!-- Switch寮�叧 --> <switch v-if="model" :class="data.disabled?'input-disabled':''" :disabled="data.disabled" - v-model="model[data.fieldId]" @change="onChange" /> - <switch v-else :class="data.disabled?'input-disabled':''" :disabled="data.disabled" v-model="data.value" + :checked="model[data.fieldId]" @change="onChange" /> + <switch v-else :class="data.disabled?'input-disabled':''" :disabled="data.disabled" checked="data.value" @change="onChange" /> </view> </template> @@ -20,7 +20,11 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.data.value = e.detail.value + if (this.model) + this.model[this.data.fieldId] = e.detail.value + + this.$emit("on-change", e) }, diff --git a/components/oi-form/list/textarea/index.vue b/components/oi-form/list/textarea/index.vue index 57957fd..79fa22a 100644 --- a/components/oi-form/list/textarea/index.vue +++ b/components/oi-form/list/textarea/index.vue @@ -25,15 +25,17 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.$emit("on-change", e) }, onConfirm(e) { this.onChange(e) }, onClick(e) { - this.$emit("click", e) + this.$emit("on-click", e) }, - + onFocus(e) { + this.$emit("on-focus", e) + }, } }; @@ -42,7 +44,7 @@ <style lang="scss" scoped> .oi-form-textarea { border: 1px solid #d5d5d5; - width: calc(100%- 6rpx); + width: calc(100% - 6rpx); border-radius: 6px !important; padding: 3rpx; diff --git a/index.html b/index.html new file mode 100644 index 0000000..3c3a30f --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta + name="viewport" + content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" + /> + <title></title> + </head> + <body> + <div id="app"><!--app-html--></div> + <script type="module" src="/main.js"></script> + </body> +</html> diff --git a/js/base64.js b/js/base64.js new file mode 100644 index 0000000..ea13995 --- /dev/null +++ b/js/base64.js @@ -0,0 +1,109 @@ +//鍔犲瘑銆佽В瀵嗙畻娉曞皝瑁咃細 +const _base64KeyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +var Base64 ={ + + + // public method for encoding + encode(input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + input = this._utf8_encode(input); + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output = output + + _base64KeyStr.charAt(enc1) + _base64KeyStr.charAt(enc2) + + _base64KeyStr.charAt(enc3) + _base64KeyStr.charAt(enc4); + } + return output; + }, + + // public method for decoding + decode(input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i < input.length) { + enc1 = _base64KeyStr.indexOf(input.charAt(i++)); + enc2 = _base64KeyStr.indexOf(input.charAt(i++)); + enc3 = _base64KeyStr.indexOf(input.charAt(i++)); + enc4 = _base64KeyStr.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + } + output = this._utf8_decode(output); + return output; + }, + + // private method for UTF-8 encoding + _utf8_encode(string) { + string = string.replace(/\r\n/g, "\n"); + var utftext = ""; + for (var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + utftext += String.fromCharCode(c); + } else if ((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + return utftext; + }, + + // private method for UTF-8 decoding + _utf8_decode (utftext) { + var string = ""; + var i = 0; + var c = 0,c1 = 0,c2 = 0; + let c3 + while (i < utftext.length) { + c = utftext.charCodeAt(i); + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if ((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i + 1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = utftext.charCodeAt(i + 1); + c3 = utftext.charCodeAt(i + 2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + return string; + }, + +} + +export { + Base64, +} \ No newline at end of file diff --git a/libs/mobox.api.js b/libs/mobox.api.js index d640814..aa3f6bd 100644 --- a/libs/mobox.api.js +++ b/libs/mobox.api.js @@ -1,27 +1,36 @@ export default { common: { data: {}, - header: {}, + header: {"Content-Type":"application/json;charset=UTF-8"}, method: "GET", dataType: "json" }, //mobox3璋冪敤 request(options = {}) { options.data = options.data || this.common.data; - options.header = options.header || {}; + options.header = options.header || {"Content-Type":"application/json;charset=UTF-8"}; options.method = options.method || this.common.method; options.dataType = options.dataType || this.common.dataType; return new Promise((resolve, reject) => { //console.log("request:", options); - + const app = getApp() + let url = options.url + let sessionID = app.globalData.sessionId || "" + if (sessionID) { + if (url.includes("?")) { + url = `${options.url}&sessionid=${encodeURI(sessionID)}` + } else { + url = `${options.url}?sessionid=${encodeURI(sessionID)}` + } + } uni.request({ - url: options.url, + url: url, data: options.data, header: options.header, method: options.method, dataType: options.dataType, success: (result) => { - // console.log("result", result) + // console.log("result", result) if (result.statusCode != 200) { if (result.statusCode == 404) { return reject({ @@ -32,7 +41,9 @@ errMsg: "璁块棶澶辫触锛岀姸鎬佺爜锛� + result.statusCode }) } - + if (options.raw) { + return resolve(result.data); + } var ret = result.data if (typeof ret == 'string') { try { @@ -56,9 +67,19 @@ } if (ret.code == '00000' || ret.err_code == 0) { resolve(ret.result); + } else if (ret.code == '1102' || ret.err_code == 1102 || ret.errCode == 1102) { + uni.reLaunch({ + url: '/pages/login/index' + }) + } else if (ret.code == '12201' || ret.err_code == 12201 || ret.errCode == + 12201) { + reject({ + errMsg: ret.msg || ret.err_msg || ret.errMsg || '鏈煡閿欒!', + errCode: 12201 + }); } else { reject({ - errMsg: ret.msg || ret.err_msg || ret.errMsg + errMsg: ret.msg || ret.err_msg || ret.errMsg || '鏈煡閿欒!' }); } }, @@ -77,15 +98,24 @@ options.dataType = options.dataType || this.common.dataType; return new Promise((resolve, reject) => { //console.log("request:", options); - + const app = getApp() + let loginInfo = { + uname: app.globalData.loginUser.id || "", + pwd: app.globalData.loginUser.pwd || "", + cname: app.globalData.cname || "", + type: "0", + } + if (options.data) { + options.data.loginInfo = JSON.stringify(loginInfo) + } uni.request({ - url: options.url, + url: url, data: options.data, header: options.header, method: options.method, dataType: options.dataType, success: (result) => { - // console.log("result", result) + // console.log("result", result) if (result.statusCode != 200) { if (result.statusCode == 404) { return reject({ @@ -96,7 +126,7 @@ errMsg: "璁块棶澶辫触锛岀姸鎬佺爜锛� + result.statusCode }) } - + var ret = result.data if (typeof ret == 'string') { try { diff --git a/main.js b/main.js index e10c420..963bcc9 100644 --- a/main.js +++ b/main.js @@ -1,18 +1,19 @@ -import Vue from 'vue' import App from './App' -import store from "./store"; // i18n import messages from './locale' -import VueI18n from 'vue-i18n' const i18nConfig = { locale: uni.getLocale(), messages } +// #ifndef VUE3 +import Vue from 'vue' +import './uni.promisify.adaptor' +import VueI18n from 'vue-i18n' +import './uni.promisify.adaptor' Vue.use(VueI18n) Vue.config.productionTip = false -Vue.prototype.$store = store App.mpType = 'app' const i18n = new VueI18n(i18nConfig) @@ -22,5 +23,24 @@ ...App, i18n, }) +app.$mount() +// #endif -app.$mount() \ No newline at end of file +// #ifdef VUE3 +import { + createSSRApp +} from 'vue' +import { + createI18n +} from 'vue-i18n' + +const i18n = new createI18n(i18nConfig) + +export function createApp() { + const app = createSSRApp(App) + app.use(i18n) + return { + app + } +} +// #endif \ No newline at end of file diff --git a/manifest.json b/manifest.json index 13692ce..4191a1c 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "MoboxPDA", "appid" : "__UNI__56D451E", "description" : "", - "versionName" : "1.1.48", - "versionCode" : 1148, + "versionName" : "1.1.52", + "versionCode" : 1152, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ "app-plus" : { @@ -75,5 +75,6 @@ }, "mp-toutiao" : { "usingComponents" : true - } + }, + "vueVersion" : "3" } diff --git a/mixins/button-click.js b/mixins/button-click.js new file mode 100644 index 0000000..ac2ab58 --- /dev/null +++ b/mixins/button-click.js @@ -0,0 +1,20 @@ +// buttonClick.js +export default { + data() { + return { + btnLoading: false, // 鏍囧織浣嶏紝琛ㄧず鏄惁姝e湪澶勭悊涓�+ }; + }, + methods: { + handleButtonClick(callback) { + if (this.btnLoading) return; // 濡傛灉姝e湪澶勭悊涓紝鐩存帴杩斿洖 + this.btnLoading = true; // 璁剧疆涓哄鐞嗕腑 + // 鎵ц鍥炶皟鍑芥暟 + if (typeof callback === 'function') { + callback(() => { + this.btnLoading = false; // 閲嶇疆鐘舵� + }); + } + }, + }, +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 60cf0f4..ce1bfa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "dependencies": { "dayjs": "^1.11.13", - "vue-i18n": "^9.13.1" + "vue-i18n": "^9.14.3" } }, "node_modules/@babel/helper-string-parser": { @@ -28,12 +28,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.3", - "resolved": "https://r.cnpmjs.org/@babel/parser/-/parser-7.26.3.tgz", - "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "version": "7.26.10", + "resolved": "https://r.cnpmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", "peer": true, "dependencies": { - "@babel/types": "^7.26.3" + "@babel/types": "^7.26.10" }, "bin": { "parser": "bin/babel-parser.js" @@ -43,9 +43,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.3", - "resolved": "https://r.cnpmjs.org/@babel/types/-/types-7.26.3.tgz", - "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "version": "7.26.10", + "resolved": "https://r.cnpmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.25.9", @@ -56,12 +56,12 @@ } }, "node_modules/@intlify/core-base": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/core-base/-/core-base-9.14.2.tgz", - "integrity": "sha512-DZyQ4Hk22sC81MP4qiCDuU+LdaYW91A6lCjq8AWPvY3+mGMzhGDfOCzvyR6YBQxtlPjFqMoFk9ylnNYRAQwXtQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/core-base/-/core-base-9.14.3.tgz", + "integrity": "sha512-nbJ7pKTlXFnaXPblyfiH6awAx1C0PWNNuqXAR74yRwgi5A/Re/8/5fErLY0pv4R8+EHj3ZaThMHdnuC/5OBa6g==", "dependencies": { - "@intlify/message-compiler": "9.14.2", - "@intlify/shared": "9.14.2" + "@intlify/message-compiler": "9.14.3", + "@intlify/shared": "9.14.3" }, "engines": { "node": ">= 16" @@ -71,11 +71,11 @@ } }, "node_modules/@intlify/message-compiler": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/message-compiler/-/message-compiler-9.14.2.tgz", - "integrity": "sha512-YsKKuV4Qv4wrLNsvgWbTf0E40uRv+Qiw1BeLQ0LAxifQuhiMe+hfTIzOMdWj/ZpnTDj4RSZtkXjJM7JDiiB5LQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/message-compiler/-/message-compiler-9.14.3.tgz", + "integrity": "sha512-ANwC226BQdd+MpJ36rOYkChSESfPwu3Ss2Faw0RHTOknYLoHTX6V6e/JjIKVDMbzs0/H/df/rO6yU0SPiWHqNg==", "dependencies": { - "@intlify/shared": "9.14.2", + "@intlify/shared": "9.14.3", "source-map-js": "^1.0.2" }, "engines": { @@ -86,9 +86,9 @@ } }, "node_modules/@intlify/shared": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/shared/-/shared-9.14.2.tgz", - "integrity": "sha512-uRAHAxYPeF+G5DBIboKpPgC/Waecd4Jz8ihtkpJQD5ycb5PwXp0k/+hBGl5dAjwF7w+l74kz/PKA8r8OK//RUw==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/shared/-/shared-9.14.3.tgz", + "integrity": "sha512-hJXz9LA5VG7qNE00t50bdzDv8Z4q9fpcL81wj4y4duKavrv0KM8YNLTwXNEFINHjTsfrG9TXvPuEjVaAvZ7yWg==", "engines": { "node": ">= 16" }, @@ -246,9 +246,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://r.cnpmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "version": "3.3.11", + "resolved": "https://r.cnpmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", "funding": [ { "type": "github", @@ -270,9 +270,9 @@ "peer": true }, "node_modules/postcss": { - "version": "8.4.49", - "resolved": "https://r.cnpmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "version": "8.5.3", + "resolved": "https://r.cnpmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "funding": [ { "type": "opencollective", @@ -289,7 +289,7 @@ ], "peer": true, "dependencies": { - "nanoid": "^3.3.7", + "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -327,12 +327,12 @@ } }, "node_modules/vue-i18n": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/vue-i18n/-/vue-i18n-9.14.2.tgz", - "integrity": "sha512-JK9Pm80OqssGJU2Y6F7DcM8RFHqVG4WkuCqOZTVsXkEzZME7ABejAUqUdA931zEBedc4thBgSUWxeQh4uocJAQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/vue-i18n/-/vue-i18n-9.14.3.tgz", + "integrity": "sha512-C+E0KE8ihKjdYCQx8oUkXX+8tBItrYNMnGJuzEPevBARQFUN2tKez6ZVOvBrWH0+KT5wEk3vOWjNk7ygb2u9ig==", "dependencies": { - "@intlify/core-base": "9.14.2", - "@intlify/shared": "9.14.2", + "@intlify/core-base": "9.14.3", + "@intlify/shared": "9.14.3", "@vue/devtools-api": "^6.5.0" }, "engines": { @@ -360,18 +360,18 @@ "peer": true }, "@babel/parser": { - "version": "7.26.3", - "resolved": "https://r.cnpmjs.org/@babel/parser/-/parser-7.26.3.tgz", - "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "version": "7.26.10", + "resolved": "https://r.cnpmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", "peer": true, "requires": { - "@babel/types": "^7.26.3" + "@babel/types": "^7.26.10" } }, "@babel/types": { - "version": "7.26.3", - "resolved": "https://r.cnpmjs.org/@babel/types/-/types-7.26.3.tgz", - "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "version": "7.26.10", + "resolved": "https://r.cnpmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", "peer": true, "requires": { "@babel/helper-string-parser": "^7.25.9", @@ -379,27 +379,27 @@ } }, "@intlify/core-base": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/core-base/-/core-base-9.14.2.tgz", - "integrity": "sha512-DZyQ4Hk22sC81MP4qiCDuU+LdaYW91A6lCjq8AWPvY3+mGMzhGDfOCzvyR6YBQxtlPjFqMoFk9ylnNYRAQwXtQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/core-base/-/core-base-9.14.3.tgz", + "integrity": "sha512-nbJ7pKTlXFnaXPblyfiH6awAx1C0PWNNuqXAR74yRwgi5A/Re/8/5fErLY0pv4R8+EHj3ZaThMHdnuC/5OBa6g==", "requires": { - "@intlify/message-compiler": "9.14.2", - "@intlify/shared": "9.14.2" + "@intlify/message-compiler": "9.14.3", + "@intlify/shared": "9.14.3" } }, "@intlify/message-compiler": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/message-compiler/-/message-compiler-9.14.2.tgz", - "integrity": "sha512-YsKKuV4Qv4wrLNsvgWbTf0E40uRv+Qiw1BeLQ0LAxifQuhiMe+hfTIzOMdWj/ZpnTDj4RSZtkXjJM7JDiiB5LQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/message-compiler/-/message-compiler-9.14.3.tgz", + "integrity": "sha512-ANwC226BQdd+MpJ36rOYkChSESfPwu3Ss2Faw0RHTOknYLoHTX6V6e/JjIKVDMbzs0/H/df/rO6yU0SPiWHqNg==", "requires": { - "@intlify/shared": "9.14.2", + "@intlify/shared": "9.14.3", "source-map-js": "^1.0.2" } }, "@intlify/shared": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/@intlify/shared/-/shared-9.14.2.tgz", - "integrity": "sha512-uRAHAxYPeF+G5DBIboKpPgC/Waecd4Jz8ihtkpJQD5ycb5PwXp0k/+hBGl5dAjwF7w+l74kz/PKA8r8OK//RUw==" + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/@intlify/shared/-/shared-9.14.3.tgz", + "integrity": "sha512-hJXz9LA5VG7qNE00t50bdzDv8Z4q9fpcL81wj4y4duKavrv0KM8YNLTwXNEFINHjTsfrG9TXvPuEjVaAvZ7yWg==" }, "@jridgewell/sourcemap-codec": { "version": "1.5.0", @@ -542,9 +542,9 @@ } }, "nanoid": { - "version": "3.3.8", - "resolved": "https://r.cnpmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "version": "3.3.11", + "resolved": "https://r.cnpmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", "peer": true }, "picocolors": { @@ -554,12 +554,12 @@ "peer": true }, "postcss": { - "version": "8.4.49", - "resolved": "https://r.cnpmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "version": "8.5.3", + "resolved": "https://r.cnpmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "peer": true, "requires": { - "nanoid": "^3.3.7", + "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } @@ -583,12 +583,12 @@ } }, "vue-i18n": { - "version": "9.14.2", - "resolved": "https://r.cnpmjs.org/vue-i18n/-/vue-i18n-9.14.2.tgz", - "integrity": "sha512-JK9Pm80OqssGJU2Y6F7DcM8RFHqVG4WkuCqOZTVsXkEzZME7ABejAUqUdA931zEBedc4thBgSUWxeQh4uocJAQ==", + "version": "9.14.3", + "resolved": "https://r.cnpmjs.org/vue-i18n/-/vue-i18n-9.14.3.tgz", + "integrity": "sha512-C+E0KE8ihKjdYCQx8oUkXX+8tBItrYNMnGJuzEPevBARQFUN2tKez6ZVOvBrWH0+KT5wEk3vOWjNk7ygb2u9ig==", "requires": { - "@intlify/core-base": "9.14.2", - "@intlify/shared": "9.14.2", + "@intlify/core-base": "9.14.3", + "@intlify/shared": "9.14.3", "@vue/devtools-api": "^6.5.0" } } diff --git a/package.json b/package.json index a860e43..c7a2f12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { "dayjs": "^1.11.13", - "vue-i18n": "^9.13.1" + "vue-i18n": "^9.14.3" } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 6cb2d26..486f506 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,32 +1,39 @@ <template> <view class="uni-page-index"> - <view class="v-area" v-for="(area,index) in data"> - <p :data-key="area.ID?area.ID:area.id">{{ area.Name?area.Name:area.name }}</p> - <ul class="areaList"> - <!-- Mobox2 --> - <li v-for="(app,key) in area.App"> - <a @tap="appCreate(app)" class="logo" :style="{'background-color':app.BkColor,'color':app.BkColor}"> - <i :class="app.ImgFontStyle" :style="{'color':app.TxtColor}"></i> - </a> - <p :data-key="app.ID">{{ app.Name }}</p> - </li> - <!-- Mobox3 --> - <li v-for="(app,key) in area.app_list"> - <a @tap="appCreate(app)" class="logo" - :style="{'background-color':app.bk_color,'color':app.bk_color}"> - <i :class="app.img_font_style" :style="{'color':app.txt_color}"></i> - </a> - <p :data-key="app.id">{{ app.list_name|| app.name}}</p> - </li> + <view class="area-list" v-if="isMobox3"> + <view class="v-area" v-for="(area,index) in data"> + <view class="area-name">{{ area.name }}</view> + <view class="app-list"> + <view class="app" v-for="(app,key) in area.app_list" :key="key"> + <a @click="onClickApp(app)" class="logo" + :style="{'background-color':app.bk_color,'color':app.bk_color}"> + <text class="ico" :class="app.img_font_style" :style="{'color':app.txt_color}"></text> + </a> + <view @click="onClickApp(app)" class="app-name">{{app.name}}</view> + </view> + </view> + </view> - </ul> </view> - + <view class="area-list" v-else> + <view class="v-area" v-for="(area,index) in data"> + <view class="area-name">{{ area.Name }}</view> + <view class="app-list"> + <view class="app" v-for="(app,key) in area.App" :key="key"> + <a @click="onClickApp(app)" class="logo" + :style="{'background-color':app.BkColor,'color':app.BkColor}"> + <text class="ico" :class="app.ImgFontStyle" :style="{'color':app.TxtColor}"></text> + </a> + <view @click="onClickApp(app)" class="app-name">{{app.Name}}</view> + </view> + </view> + </view> + </view> </view> </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import {Base64} from '@/js/Base64.js'; import utils from "@/js/utils.js" import { areaFunc @@ -34,23 +41,24 @@ import { getFuncTree } from "@/api/mobox.js" + import buttonClickMixin from '@/mixins/button-click.js'; export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], onNavigationBarButtonTap(e) { this.loadData() }, data() { return { title: 'Hello', - data: [] + data: [], + isMobox3: getApp().globalData.isMobox3, } }, onLoad(options) { console.log(options); // 鑾峰彇鎵�湁AppType="MES",ClientType="2"(PDA)鐨勫紩鐢ㄩ鍩熷姛鑳界偣淇℃伅 + this.loadData() }, @@ -85,7 +93,7 @@ const appType = utils.session.getValue('app_type') || "MES"; const list = await areaFunc(appType, 1) || [] const app = getApp() - if (app.globalData.isMobox3) { + if (this.isMobox3) { const list2 = [] for (let i in list) { const area = list[i] @@ -148,13 +156,22 @@ return undefined } }, + onClickApp(appInfo) { + this.handleButtonClick((done) => { + this.appCreate(appInfo) + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + + }, appCreate(appInfo) { //鐐瑰嚮鍔熻兘鐐硅烦杞〉闈� console.log(appInfo); const app = getApp() - var paramStr = app.globalData.isMobox3 ? appInfo.param : appInfo.Param; - var appName = app.globalData.isMobox3 ? (appInfo.list_name || appInfo.name) : appInfo.Name; - var defCode = app.globalData.isMobox3 ? appInfo.def_code : appInfo.DefCode; + var paramStr = this.isMobox3 ? appInfo.param : appInfo.Param; + var appName = this.isMobox3 ? (appInfo.list_name || appInfo.name) : appInfo.Name; + var defCode = this.isMobox3 ? appInfo.def_code : appInfo.DefCode; var param = ""; if (paramStr) { //mobox2鐨刾aram鏄痡son瀛楃涓�@@ -173,7 +190,7 @@ return; } if (defCode == '3018') { - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ // url:'../modal/3018?param='+param+"&titlename="+appName url: '../modal/3018_2?param=' + param + "&titlename=" + appName @@ -184,7 +201,7 @@ }); } } else if (defCode == '3037') { - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ // url:'../modal/3037?param='+param+"&titlename="+appName url: '../modal/3037_2?param=' + param + "&titlename=" + appName @@ -195,31 +212,31 @@ }); } } else if (defCode == '3200') { - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ url: '../modal/3200?param=' + param + "&titlename=" + appName }); } } else if (defCode == '3201') { - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ url: '../modal/3201?param=' + param + "&titlename=" + appName }); } } else if (defCode == '5600') { //鐮佺洏 - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ url: '../modal/5600?param=' + param + "&titlename=" + appName }); } } else if (defCode == '5601') { //鐮佺洏 - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ url: '../modal/5601?param=' + param + "&titlename=" + appName }); } } else if (defCode == '5602') { //鍒嗘嫞 - if (app.globalData.isMobox3) { //Mobox3 + if (this.isMobox3) { //Mobox3 uni.navigateTo({ url: '../modal/5602?param=' + param + "&titlename=" + appName }); @@ -234,7 +251,7 @@ // console.log(e.target) getApp().onScan((result) => { // console.log(result.decodedata); - this.$data.data[e.target.dataset['key']] = result.decodedata; + this.data[e.target.dataset['key']] = result.decodedata; }) }, translate(t) { @@ -251,23 +268,67 @@ <style lang="scss"> .uni-page-index { - - width: 100vw; - min-height: 100vh; + width: 750rpx; + height: 100vh; background: #EAEAEA; - padding: 1rpx 0rpx; + display: flex; + .area-list { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + overflow-y: auto; + + .v-area { + border-radius: 12rpx; + margin: 10rpx ; + padding: 10rpx; + background: #FFFFFF; + display: flex; + flex-direction: column; + width:calc(100% - 40rpx); + .area-name { + font-size: 40rpx; + width: 100%; + padding: 10rpx ; + } + .app-list { + width: 100%; + padding: 0; + display: flex; + flex-direction: row; + flex-wrap: wrap; + .app { + padding: 20rpx 25rpx 15rpx 25rpx; + text-align: center; + font-size: 14px; + width: 125rpx; + display: flex; + flex-direction: column; + .logo { + height: 105rpx; + width: 105rpx; + border-radius: 20rpx; + padding: 10rpx; + color: #000000; + border: 0px solid rgb(221, 221, 221); + .ico { + color: #000000; + font-size: 40px; + line-height:105rpx; + } + } - .v-area { - border-radius: 12rpx; - margin: 30rpx; - padding: 10rpx; - background: #FFFFFF; + .app-name { + padding-top: 10rpx ; + } + } + } + } + } - .areaList { - padding: 0; - } .areaList li { /* border: 1px solid #0062CC; */ @@ -277,7 +338,7 @@ padding: 30rpx 10rpx 16rpx 10rpx; text-align: center; font-size: 14px; - width: 100px; + width: 140rpx; vertical-align: text-top; } @@ -295,7 +356,7 @@ .logo i { color: #000000; font-size: 40px; - line-height: 53px; + line-height: 120rpx; } } </style> \ No newline at end of file diff --git a/pages/login/index.vue b/pages/login/index.vue index 1cb579e..de2efe3 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -8,12 +8,6 @@ <a href="javascript:;" class="SetServer" @click="inputDialogToggle">{{translateSys('set')}}</a> <a href="javascript:;" class="SetServer" @click="clickSetLanguage">{{translateSys('language')}}</a> - - <!-- <div class="mui-input-row"> - <label class="la_icon"><image class="logo_input" src="../../images/login/svr_30.png"></image></label> - <input type="text" class="mui-input" v-model="userServer" placeholder="鏈嶅姟鍣ㄥ湴鍧�> - <label class="mui-navigate-right" id="sersel"><image class="logo_icon" src="../../images/login/sel_left.png" ></image></label> - </div> --> <div class="mui-input-row"> <label class="la_icon"> <image class="logo_input" src="../../images/login/person_30.png"></image> @@ -35,7 +29,8 @@ </label> </checkbox-group> </form> - <button id='login' type="default" @tap="logind" class="btn_login">{{translateSys("start_login")}}</button> + <button id='login' :disabled="btnLoading" type="default" @tap="onClickLogin" + class="btn_login">{{translateSys("start_login")}}</button> <p style="float:right; margin: 10px 10px;color:#c8c7cc"> <span>{{translateSys('version')}}锛�/span> <span>{{version}}</span> @@ -91,9 +86,11 @@ login, getApkVersionInfo } from "@/api/index.js" + import buttonClickMixin from '@/mixins/button-click.js'; import utils from "@/js/utils.js" export default { + mixins: [buttonClickMixin], components: { cmdProgress }, @@ -312,7 +309,7 @@ console.log(e.target); utils.session.setValue('account', ''); utils.session.setValue('password', ''); - if (e.target.value[0] == '1') { + if (e.detail.value[0] == '1') { utils.session.setValue('account', this.userName); utils.session.setValue('password', this.userPwd); } @@ -336,6 +333,14 @@ // ((expiredays==null)?'':';expires='+exdate.toGMTString()); // }, + onClickLogin() { + this.handleButtonClick((done) => { + this.logind() + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + }, async logind() { try { if (!this.userServer) { @@ -420,7 +425,7 @@ }, onLoad(options) { //鑾峰彇mac鍦板潃 - + var url = utils.session.getValue('server'); var username = utils.session.getValue('account'); var userpwd = utils.session.getValue('password'); @@ -457,7 +462,7 @@ console.log('Android璁惧鐨刣eviceId:', deviceId); plus.runtime.getProperty(plus.runtime.appid, (info) => { // console.log(info); - this.$data.version = info.version; + this.version = info.version; }); } } diff --git a/pages/login/set.vue b/pages/login/set.vue index c63f679..802e4fe 100644 --- a/pages/login/set.vue +++ b/pages/login/set.vue @@ -1,24 +1,26 @@ <template> <view class="uni-page-login-set"> - <uni-forms class="form" label-align="right" label-width="100px" :form="form"> + <uni-forms class="form" label-align="right" label-width="100px" :form="form"> <uni-section :title="translateSys('page.server')" type="line"> - <input type="text" class="input-wrapper" v-model="form.server" :placeholder="translateSys('page.input_server')"> + <input type="text" class="input-wrapper" v-model="form.server" + :placeholder="translateSys('page.input_server')"> </uni-section> <uni-section :title="translateSys('page.mobox3_app_type')" type="line"> - <input type="text" class="input-wrapper" v-model="form.appType" :placeholder="translateSys('page.input_server')"> + <input type="text" class="input-wrapper" v-model="form.appType" + :placeholder="translateSys('page.input_server')"> </uni-section> <uni-section :title="translateSys('page.mobox3_port')" type="line"> <uni-forms-item label="OrgSAPI"> - <input type="number" class="input-wrapper" v-model="form.orgSPort"> + <input type="number" class="input-wrapper" v-model="form.orgSPort"> </uni-forms-item> <uni-forms-item label="MoboxSAPI"> - <input type="number" class="input-wrapper" v-model="form.moboxSPort"> + <input type="number" class="input-wrapper" v-model="form.moboxSPort"> </uni-forms-item> <uni-forms-item label="DataSAPI"> - <input type="number" class="input-wrapper" v-model="form.dataSPort"> + <input type="number" class="input-wrapper" v-model="form.dataSPort"> </uni-forms-item> <uni-forms-item label="MongodbSvr"> - <input type="number" class="input-wrapper" v-model="form.mongodbSPort"> + <input type="number" class="input-wrapper" v-model="form.mongodbSPort"> </uni-forms-item> </uni-section> </uni-forms> @@ -29,6 +31,7 @@ <script> import utils from "@/js/utils.js" + export default { data() { return { @@ -53,9 +56,9 @@ data: this.form.dataSPort, mongodb: this.form.mongodbSPort }); - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); eventChannel.emit('exitSetEvent', this.form.server); - + uni.navigateBack({ delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }) @@ -89,10 +92,12 @@ display: flex; width: 750rpx; flex-direction: column !important; - .form{ + + .form { padding: 20rpx; - + } + .input-wrapper { border: 1px solid #d5d5d5; width: calc(100% - 16rpx); diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue index 358b80c..93a00e0 100644 --- a/pages/modal/3018.vue +++ b/pages/modal/3018.vue @@ -22,18 +22,20 @@ <a @tap="classAttr_extButton(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input + <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'" - :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" - :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" - :disabled="attr.edit?false:true"> + :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" + @blur="onevent" v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" + :style="{'width':attr.Width}" :disabled="attr.edit?false:true"> <!-- =='flase'?true:false --> <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" - :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" style="height:60px;" - :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> + :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" + style="height:60px;" :style="{'width':attr.Width}" + :disabled="attr.edit?false:true"></textarea> <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" - :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" style="height:90px;" - :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> + :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" + style="height:90px;" :style="{'width':attr.Width}" + :disabled="attr.edit?false:true"></textarea> <!-- 鎵爜鍚庝簨浠惰繑鍥�--> <div class="input_vallist"> <ul v-for="(inputval,vindex) in inputValList"> @@ -47,18 +49,19 @@ <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float' ?'number':'text'" - class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent" - v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" + class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index" + :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"> - <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent" - v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex" - style="height:60px;" + <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index" + :data-iindex="iindex" style="height:60px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"></textarea> - <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent" - v-else-if="attr.Height=='3'" :data-index="index" :data-iindex="iindex" - style="height:90px;" + <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index" + :data-iindex="iindex" style="height:90px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"></textarea> <div class="text-right2" v-if="attr.ext_button==true"> @@ -153,7 +156,8 @@ </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> - <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" + <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" + :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" disabled="true" :maxlength="-1"> <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'"> @@ -179,12 +183,13 @@ <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" - :maxlength="-1"> + <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> - <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" + :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" disabled="true" :maxlength="-1"> <div class="text-right2"> @@ -203,12 +208,13 @@ <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" - :maxlength="-1"> + <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> - <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" + <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" + :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" disabled="true" :maxlength="-1"> <div class="text-right2"> @@ -223,12 +229,14 @@ <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> - <input type="text" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" - :disabled="attr.edit?false:true" :maxlength="-1"> + <input type="text" :class="attr.edit?'':'input-disabled'" :data-index="index" + :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true" + :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> - <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" + <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" + :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}" :disabled="attr.edit?false:true" :maxlength="-1"> <i class="i_tishi" v-if="attr.notempty==true">*</i> @@ -257,7 +265,8 @@ </view> - <view class="v-bottom"><button type="default" @tap="ok" class="btn_add">{{title}}</button> + <view class="v-bottom"> + <button type="default" @click="onClickOK" class="btn_add">{{title}}</button> <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> </view> @@ -293,7 +302,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' import utils from "@/js/utils.js" import { @@ -310,18 +321,17 @@ classAttrList, } from "@/api/index.js" + import buttonClickMixin from '@/mixins/button-click.js'; export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { pickerAddress }, onBackPress(e) { // console.log("鐩戝惉杩斿洖鎸夐挳浜嬩欢",e); if (this.type) { - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, ""); } @@ -370,9 +380,9 @@ title: options.titlename }); //璁剧疆椤堕儴鏍囬 var param = JSON.parse(options.param); - this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 + this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 if (options.type) { - this.$data.type = options.type; + this.type = options.type; } this.editMode = options.editMode ? true : false; if (options.objAttr) @@ -402,7 +412,7 @@ }); return; } - this.$data.param = param; + this.param = param; this.loadData() }, @@ -452,7 +462,7 @@ } } } - $this.$data.classAttrList = result; + $this.classAttrList = result; await $this.classGridStyleInfo(); } catch (ex) { // console.log(ex); @@ -506,7 +516,7 @@ const result = await getUIStyleInfo(gridstyleInfo) var styledef = Base64.decode(result.style_def); result.style_def = JSON.parse(styledef); - $this.$data.classGridStyle = result + $this.classGridStyle = result $this.viewParam(); } catch (ex) { @@ -537,13 +547,10 @@ attr: "state", value: info.state }] - info.attr_list.forEach(({ - name, - value - }) => { + info.attr_list.forEach((attr) => { attrs.push({ - attr: name, - value: value + attr: attr.name, + value: attr.value }) }); this.setFormValues(attrs) @@ -562,15 +569,15 @@ async viewParam() { //灏唌obox3灏忓啓鍙傛暟杞崲涓簃obox2澶у啓鍙傛暟 try { var class_gridStyle = { - ID: this.$data.classGridStyle.id, - Name: this.$data.classGridStyle.name, - Type: this.$data.classGridStyle.type, - IsDefault: this.$data.classGridStyle.is_defaul, - StyleDef: this.$data.classGridStyle.style_def, + ID: this.classGridStyle.id, + Name: this.classGridStyle.name, + Type: this.classGridStyle.type, + IsDefault: this.classGridStyle.is_defaul, + StyleDef: this.classGridStyle.style_def, }; - this.$data.classGridStyle = class_gridStyle; + this.classGridStyle = class_gridStyle; var class_attrList = []; - this.$data.classAttrList.forEach(data => { + this.classAttrList.forEach(data => { var attrs = []; if (data.attr_list) { data.attr_list.forEach(attr => { @@ -651,9 +658,9 @@ Attr: attrs }); }); - this.$data.classAttrList = class_attrList; - // console.log(this.$data.classGridStyle); - // console.log(this.$data.classAttrList); + this.classAttrList = class_attrList; + // console.log(this.classGridStyle); + // console.log(this.classAttrList); await this.class_attr_init(); } catch (ex) { @@ -671,15 +678,15 @@ }, async class_attr_init() { try { - var attrlist = this.$data.classGridStyle.StyleDef.show_style + var attrlist = this.classGridStyle.StyleDef.show_style var newattrlist = []; - if (this.$data.classAttrList.length > 0) { + if (this.classAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - for (var s = 0; s < this.$data.classAttrList.length; s++) { - var clsattr = this.$data.classAttrList[s]; + for (var s = 0; s < this.classAttrList.length; s++) { + var clsattr = this.classAttrList[s]; // if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -746,19 +753,19 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.classGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith + control_style: this.classGridStyle.StyleDef.control_style, + title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith }) // } } } if (newattrlist.length > 0) { - this.$data.classAttrList = newattrlist; + this.classAttrList = newattrlist; } var req = []; - if (this.$data.classGridStyle.StyleDef) { - if (this.$data.classGridStyle.StyleDef.show_style.length > 0) { - var attrlist = this.$data.classGridStyle.StyleDef.show_style + if (this.classGridStyle.StyleDef) { + if (this.classGridStyle.StyleDef.show_style.length > 0) { + var attrlist = this.classGridStyle.StyleDef.show_style // $el.find('.attr_field').prop('readonly', true); // $el.find('.attr_field').prop('disabled', true); for (var i = 0; i < attrlist.length; i++) { @@ -774,26 +781,26 @@ } } - var eventlist = this.$data.classGridStyle.StyleDef.event; + var eventlist = this.classGridStyle.StyleDef.event; // console.log(eventlist); if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } await this.loadFormData(this.objAttr) // console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -801,14 +808,14 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, } this.ini_DataObjRunCustomEvent(info); } - console.log(this.$data.classGridStyle); - console.log(this.$data.classAttrList); + console.log(this.classGridStyle); + console.log(this.classAttrList); } else { uni.showModal({ @@ -834,16 +841,16 @@ classAttr_extButton(index, iindex) { //寮规灞傛樉绀�type:top bottom center left right var $this = this; - $this.$data.popupType = 'right' + $this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� $this.$refs.popup.open($this.popupType); - var data_attr = $this.$data.classAttrList[index].Attr[iindex]; + var data_attr = $this.classAttrList[index].Attr[iindex]; // var value = action.value; // var action ={"action_type":"open_common_dlg","value":{"common_dlg_id":"check_list","config":{"title":"鐢熶骇宸ュ崟","appear_style":"sideslip","width":250,"multiple_choice":"1","items":[{"id":"133D50D7-D798-4D2E-A15F-308365092DF5","name":"5100691673", "check":false},{"id":"22992021-7D3B-4959-86B7-EF184B596AC6","name":"5100691674", "check":false},{"id":"48FBBE8E-594D-45D5-8C24-385C661C4A1C","name":"5100691675", "check":false},{"id":"4E429C60-325A-42ED-BEA3-B3397C07CCA1","name":"5100691668", "check":false}]}}} // if (action.action_type == 'open_common_dlg') { // var value = action.value; // if(value.common_dlg_id == 'check_list'){ - // $this.$data.check_list= value.config; + // $this.check_list= value.config; // } // } // var popupParam={ @@ -853,11 +860,11 @@ // req:"", // data_attr:data_attr // } - // $this.$data.popupParam= popupParam; + // $this.popupParam= popupParam; // return; - var before_click_button = $this.$data.classAttrList[index].Attr[iindex] + var before_click_button = $this.classAttrList[index].Attr[iindex] .before_click_button; - var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; + var button_callback = $this.classAttrList[index].Attr[iindex].button_callback; if (!before_click_button) { uni.showModal({ title: this.translateSys('tip'), @@ -883,27 +890,18 @@ if (JSON.stringify(data) == '{}') { return; } - for (var a = 0; a < this.$data.classAttrList - .length; a++) { - for (var l = 0; l < this.$data - .classAttrList[a] - .Attr - .length; l++) { - var ca = this.$data.classAttrList[a] - .Attr[l]; + for (var a = 0; a < this.classAttrList.length; a++) { + for (var l = 0; l < this.classAttrList[a].Attr.length; l++) { + var ca = this.classAttrList[a].Attr[l]; let curIndex = data.findIndex((attr) => { return attr.attr == ca.Name; }) if (curIndex > -1) { const attr = data[curIndex] - if (utils.classUtils - .attrTypeIsDict(ca - .Type)) { + if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; - for (var d in attr - .choice_list) { - var list_val = attr - .choice_list[d]; + for (var d in attr.choice_list) { + var list_val = attr.choice_list[d]; dictItemList.push({ "CN_S_NAME": list_val, "Name": list_val, @@ -917,35 +915,8 @@ } else { ca.Value = attr.value; } - - - } - } - } - - for (var i = 0; i < value.length; i++) { - - var length = 0; - if (!this.$data.refdatastore.filter(function( - s) { - return data[i].attr == s.attr - }).length) { - length = 1; - this.$data.refdatastore.push(data[i]); - } - if (length == 0) { - for (var j = 0; j < this.$data.refdatastore - .length; j++) { - if (this.$data.refdatastore[j].attr == - data[i] - .attr) { - this.$data.refdatastore[j].value = - data[i] - .value; - } - } } } }, @@ -956,15 +927,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -972,7 +943,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -986,7 +957,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys('tip'), content: "popupParam涓虹┖锛�, @@ -995,11 +966,11 @@ }); return; } - $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex] + $this.classAttrList[$this.popupParam.index].Attr[$this.popupParam.iindex] .Value = name; console.log(data); - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -1007,17 +978,17 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, cancel(e) { if (this.type) { - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, ""); } @@ -1030,7 +1001,7 @@ //console.log(e.target) getApp().onScan((result) => { console.log(result); - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .Value = result.decodedata; @@ -1040,38 +1011,37 @@ }, onarrow(index, open) { // console.log(index+'--'+open); - this.$data.classAttrList[index].Open = open == true ? false : true; + this.classAttrList[index].Open = open == true ? false : true; }, ondateTime(e) { //console.log(e.target) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .Value = e .target .value; }, onchange(e) { // console.log(e.target); - var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var value = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] - .dictitem[e - .target.value]; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + .dictitem[e.detail.value]; + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; // console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .Value = value .Name; - // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target + // console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target .dataset[ 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1086,7 +1056,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [] @@ -1103,10 +1073,10 @@ //涓虹┖鏃讹紝娓呯┖灞炴�value if (item.length == 0) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name) { - this.$data.classAttrList[i].Attr[j].Value = ""; + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) { + this.classAttrList[i].Attr[j].Value = ""; } } } @@ -1114,26 +1084,26 @@ for (var v in item) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (item[v].attr == this.$data.classAttrList[i].Attr[j].Name) { + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (item[v].attr == this.classAttrList[i].Attr[j].Name) { index = i; iindex = j; } } } var itemvalue = item[v]; - var data_attr = this.$data.classAttrList[index].Attr[iindex]; + var data_attr = this.classAttrList[index].Attr[iindex]; // console.log(data_attr); if (itemvalue.Name != data_attr.Value) { - this.$data.classAttrList[index].Attr[iindex].Value = value; - // console.log(this.$data.classAttrList[index].Attr[iindex].Value); - var eventid = this.$data.classAttrList[index].Attr[iindex].action; + this.classAttrList[index].Attr[iindex].Value = value; + // console.log(this.classAttrList[index].Attr[iindex].Value); + var eventid = this.classAttrList[index].Attr[iindex].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1154,7 +1124,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -1168,21 +1138,17 @@ }, onevent(e, decodedata) { // console.log(e.target); - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; // console.log(decodedata); - if (e.target.value != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] - .Value = - decodedata ? decodedata : e.target.value; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target - .dataset[ - 'iindex']] - .action; + if (e.detail.value != data_attr.Value) { + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + decodedata ? decodedata : e.detail.value; + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1197,7 +1163,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -1210,21 +1176,18 @@ oncheck(e) { // console.log(e.target); var ischecked = e.target.dataset.ischeck ? false : true; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; // console.log(data_attr); if (ischecked != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .Value = ischecked; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target - .dataset[ - 'iindex']] - .action; + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1239,7 +1202,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -1251,13 +1214,13 @@ }, inputValListIsDel(index) { // console.log(index); - this.$data.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList); + this.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�+ // console.log(this.inputValList); }, addresschange(e) { // console.log(e.target); console.log(e.data.join(';')) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .Value = e.data .join( ';'); @@ -1274,14 +1237,14 @@ AddPer(data, param) { // console.log(param); console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[ + $this.classAttrList[param.index].Attr[param.iindex].Value = data[ 0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[ + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[ 0] .Login + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex] + var eventid = $this.classAttrList[param.index].Attr[param.iindex] .action; if (eventid) { eventid = eventid.trim(); @@ -1293,13 +1256,13 @@ rclsid: "", robjid: "", userlogin: data[0].Login, - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: [], dataJson: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -1315,8 +1278,8 @@ showCancel: false, confirmText: this.translateSys('close') }); - // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; - // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; + // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; + // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; }, classAttr_AddPrj(index, iindex) { var param = { @@ -1330,14 +1293,14 @@ AddPer(data, param) { // console.log(param); // console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[ + $this.classAttrList[param.index].Attr[param.iindex].Value = data[ 0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[ + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[ 0].ID + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex] + var eventid = $this.classAttrList[param.index].Attr[param.iindex] .action; if (eventid) { eventid = eventid.trim(); @@ -1349,13 +1312,13 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: [], dataJson: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -1365,36 +1328,45 @@ }, getPostDataObjAttr() { var req = []; - var attrlist = this.$data.classAttrList; + const $this = this + var attrlist = $this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Value == this.translateSys("select") || ar.Value == '鈥斺�' + this - .translateSys( - "select") + '鈥斺�') ar.Value = ''; - req.push(this.formatAttr(ar)); + if (ar.Value == $this.translateSys("select") || + ar.Value == '鈥斺�' + $this.translateSys("select") + '鈥斺�') + ar.Value = ''; + req.push($this.formatAttr(ar)); } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { - if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name - }).length) { - length = 1; + + if ($this.refdatastore.length > 0) { + for (var i = 0; i < $this.refdatastore.length; i++) { + if (!req.filter((s) => { + return $this.refdatastore[i].attr == s.name; + }).length > 0) { req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'val': this.$data.refdatastore[i].value + 'attr': $this.refdatastore[i].attr, + 'val': $this.refdatastore[i].value }); } } } - + console.log(req, $this.refdatastore) var obj_attr = {}; req.forEach(item => { obj_attr[item.attr] = item.value; }); + + console.log(obj_attr) return obj_attr + }, + onClickOK() { + this.handleButtonClick(async (done) => { + await this.ok() + done(); // 閲嶇疆鐘舵� + }); }, //纭畾 async ok() { @@ -1404,18 +1376,30 @@ mask: true }); this.okLoading = true + var obj_attr = this.getPostDataObjAttr(); + console.log(obj_attr) let ret = await this.sava(); this.okLoading = false uni.hideLoading(); if (!ret) return; - obj_attr.id = this.objId; - const eventChannel = this.$scope.eventChannel; + obj_attr.id = this.objId || ""; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, obj_attr); uni.navigateBack() } catch (ex) { + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr + uni.showModal({ + title: this.translateSys('error') + " 6.1", + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); return false; } }, @@ -1426,7 +1410,7 @@ // let ret = await this.OKDataObjRunCustomEvent(); // if (!ret) return false; - if (this.$data.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚�+ if (this.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚� ret = await this.OKDataObjRunCustomEvent(); if (!ret) return false; @@ -1441,7 +1425,7 @@ } else { // let ret = await this.OKDataObjRunCustomEvent(); // if (!ret) return false; - if (this.$data.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚�+ if (this.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚� ret = await this.OKDataObjRunCustomEvent(); if (!ret) return false; } else { @@ -1452,6 +1436,16 @@ } return true; } catch (ex) { + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr + uni.showModal({ + title: this.translateSys('error') + " 5.1", + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); return false; } @@ -1459,7 +1453,7 @@ // async sava() { // try { - // if (this.$data.edit_ok_event) + // if (this.edit_ok_event) // this.OKDataObjRunCustomEvent(); // else // this.add(); @@ -1470,7 +1464,7 @@ async add() { try { var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1523,11 +1517,11 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.clsid, + cls_id: this.param.clsid, } }; @@ -1537,7 +1531,7 @@ obj_attr[item.name] = item.value; }); var dataInfo = { - class_id: this.$data.param.clsid, + class_id: this.param.clsid, class_name: '', master_cls_id: '', master_obj_id: '', @@ -1599,7 +1593,7 @@ uni.redirectTo({ url: '../modal/3018?param=' + JSON.stringify(this.$data .param) + - "&titlename=" + this.$data.title + "&titlename=" + this.title }); // this.cancel(); @@ -1632,16 +1626,16 @@ }, ini_DataObjRunCustomEvent(info) { var param = { - EditStyle: this.$data.param.Edit_dlg.Name, - ViewStyle: this.$data.param.Edit_dlg.Name, + EditStyle: this.param.Edit_dlg.Name, + ViewStyle: this.param.Edit_dlg.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } } @@ -1765,18 +1759,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d + class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1795,10 +1789,10 @@ // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: "", - // global_attr: JSON.stringify(this.$data.global_attr), dataJson:JSON.stringify(info.dataJson) + // global_attr: JSON.stringify(this.global_attr), dataJson:JSON.stringify(info.dataJson) // } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -1869,35 +1863,35 @@ var result = action.value; this.setFormValues(action.value) } else if (data.action[i].action_type == 'set_global_attr') { - $this.$data.global_attr = data.action[i].value || []; + $this.global_attr = data.action[i].value || []; } } } - if (data.result) { + if (data.result_type == 2 && data.result) { var result = data.result; for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { attr[j].Value = result[i].value; } } } - + console.log($this.refdatastore) var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i] .attr) { - $this.$data.refdatastore[j].value = result[i] + $this.refdatastore[j].value = result[i] .value; } } @@ -1923,17 +1917,17 @@ try { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id } }; - var eventid = this.$data.edit_ok_event.scrip_id; + var eventid = this.edit_ok_event.scrip_id; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1944,15 +1938,15 @@ req.push(this.formatAttr(ar)); } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { + + if (this.refdatastore.length > 0) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name + return this.refdatastore[i].attr == s.name }).length) { - length = 1; req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'val': this.$data.refdatastore[i].value + 'attr': this.refdatastore[i].attr, + 'val': this.refdatastore[i].value }); } } @@ -1964,12 +1958,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, - objid: this.$data.param.objid, + clsid: this.param.clsid, + objid: this.param.objid, attr: req, } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; info.attr.forEach(item => { obj_attr[item.attr] = item.value; @@ -2028,24 +2022,27 @@ showCancel: false, confirmText: this.translateSys('close') }); - - var result = data.result; - for (var i = 0; i < result.length; i++) { - // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); - var length = 0; - if (!this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == result[i].attr) { - this.$data.refdatastore[j].value = result[i].value; + if (data.result) { + var result = data.result; + console.log(this.refdatastore) + for (var i = 0; i < result.length; i++) { + // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); + var length = 0; + if (!this.refdatastore.filter(function(s) { + return result[i].attr == s.attr + }).length) { + length = 1; + this.refdatastore.push(result[i]); + } + if (length == 0) { + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == result[i].attr) { + this.refdatastore[j].value = result[i].value; + } } } } + } this.add(); @@ -2079,16 +2076,16 @@ DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -2096,15 +2093,15 @@ req.push(this.formatAttr(ar)) } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { + if (this.refdatastore.length > 0) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name + return this.refdatastore[i].attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'val': this.$data.refdatastore[i].value + 'attr': this.refdatastore[i].attr, + 'val': this.refdatastore[i].value }); } } @@ -2112,7 +2109,7 @@ var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d + class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d } if (data_attr) { extinfo.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -2127,11 +2124,11 @@ } // var dataInfo = { // edtype: "0", eventid: eventid, projectid: '',rclsid: '', robjid: '', userlogin: '', - // clsid: this.$data.param.clsid, objid: '',attr: JSON.stringify(req), - // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.$data.global_attr) + // clsid: this.param.clsid, objid: '',attr: JSON.stringify(req), + // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.global_attr) // } extinfo = Base64.encode(JSON.stringify(extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; req.forEach(item => { obj_attr[item.attr] = item.value; @@ -2140,7 +2137,7 @@ var dataInfo = { ed_type: "0", start_transaction: '', - class_id: this.$data.param.clsid, + class_id: this.param.clsid, class_name: '', event_id: eventid, event_name: '', @@ -2243,7 +2240,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .clsid, objid: "", attr: param.req, @@ -2272,14 +2269,14 @@ } else if (action.action_type == 'open_common_dlg') { var $this = this; if (val.common_dlg_id == 'check_list') { - $this.$data.check_list = val.config; + $this.check_list = val.config; if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.$data.popupType = 'right'; + $this.popupType = 'right'; else - $this.$data.popupType = 'center' + $this.popupType = 'center' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.$data.popupType); + $this.$refs.popup.open($this.popupType); var popupParam = { index: index, iindex: iindex, @@ -2287,7 +2284,7 @@ req: req, data_attr: data_attr } - $this.$data.popupParam = popupParam; + $this.popupParam = popupParam; } } else if (action.action_type == 'open_project_query_dlg') { @@ -2322,12 +2319,12 @@ JSON.stringify(param_), events: { AddPer(data, param) { - $this.$data.classAttrList[param + $this.classAttrList[param .index] .Attr[param .iindex].Value = data[0] .Name; - $this.$data.classAttrList[param + $this.classAttrList[param .index] .Attr[param .iindex].ValID = data[0] @@ -2513,9 +2510,11 @@ right: 30rpx; font-size: 60rpx; } + .input-disabled { background-color: #f3f3f3 !important; } + input::-webkit-input-placeholder { font-size: 12rpx; } @@ -2660,7 +2659,7 @@ padding: 20rpx; line-height: 1.5; // background: #fff; - // border: 1px solid #dcdee2; + // border: 1px solid #dcdee2; // color: #000; background: #fff; color: #000; diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue index a6080af..c1815f8 100644 --- a/pages/modal/3018_2.vue +++ b/pages/modal/3018_2.vue @@ -3,15 +3,15 @@ <view class="view-content"> <!-- 琛ㄥご鏍峰紡 --> <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :focusId="focusFieldId" - @click="onClick" @focus="ontap" @change="onEnterChange" @click-prefix="classAttr_extButton" - @click-suffix="classAttr_extButton"></OIForm> + @on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" + @on-click-suffix="classAttr_extButton"></OIForm> </view> <view class="view-bottom"> <view class="uni-padding-wrap" v-if="dropdownBtns.length>0"> <view class="uni-btn-v"> <a @tap="clickDropdownBtns"> - <Icon class="mobox-normal-more" /> + <text class="mobox-normal-more" /> </a> </view> </view> @@ -51,7 +51,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import utils from "@/js/utils.js" import dayjs from "dayjs"; import OIForm from '@/components/oi-form/index.vue' @@ -64,11 +66,10 @@ runCustomEvent, dataObjCreate } from "@/api/data.js" - + import buttonClickMixin from '@/mixins/button-click.js'; + export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm, }, @@ -82,7 +83,6 @@ edit_select_compose_event: "", //閫夋嫨缁勬垚瀵硅薄鏃惰皟鐢� edit_compose_cls_id: "", global_attr: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} scanCodeVal: "", popupType: "center", check_list: {}, @@ -149,7 +149,6 @@ edit_select_compose_event: "", //閫夋嫨缁勬垚瀵硅薄鏃惰皟鐢� edit_compose_cls_id: "", global_attr: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} scanCodeVal: "", popupType: "center", check_list: {}, @@ -175,10 +174,10 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.param = JSON.parse(options.param); - this.$data.title = this.$data.param.Add_BtnName ? this.$data.param.Add_BtnName : options + this.param = JSON.parse(options.param); + this.title = this.param.Add_BtnName ? this.param.Add_BtnName : options .titlename; //璁剧疆鎸夐挳鏂囧瓧 - this.$data.btnName = this.$data.param.Add_BtnName || "" + this.btnName = this.param.Add_BtnName || "" this.loadData(options.paramValue) }, computed: { @@ -218,7 +217,7 @@ //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -467,7 +466,7 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; $this.hideFormItems(result) - // console.log($this.$data.head_styledef); + // console.log($this.head_styledef); } else if (action.action_type == "set_dlg_current_edit_attr" ) { @@ -579,7 +578,7 @@ const $this = this; //console.log("onScanValue", item); item.value = value - let newVal = item.value + let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() } @@ -603,7 +602,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.DataCls.id, + clsid: this.param.DataCls.id, objid: "", attr: req, dataJson: [], @@ -677,8 +676,12 @@ let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() - if (!newVal) + if (!newVal) { + item.oldvalue = newVal; + var attr = item.fieldId; + this.head_styledef.form.model[attr] = newVal; return + } } if (item.oldvalue != newVal) { item.oldvalue = newVal; @@ -709,7 +712,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.DataCls.id, + clsid: this.param.DataCls.id, objid: "", attr: req, dataJson: [] @@ -741,7 +744,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -755,15 +758,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -771,7 +774,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -785,7 +788,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, @@ -803,7 +806,7 @@ }); return; } - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -811,12 +814,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.DataCls.id, + clsid: $this.param.DataCls.id, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, @@ -824,18 +827,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.DataCls.id, //褰撳墠鏁版嵁绫籭d + class_id: this.param.DataCls.id, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -854,11 +857,11 @@ // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: "", - // global_attr: JSON.stringify(this.$data.global_attr), dataJson:JSON.stringify(info.dataJson) + // global_attr: JSON.stringify(this.global_attr), dataJson:JSON.stringify(info.dataJson) // } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var input_param = Base64.encode(JSON.stringify(info.attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -935,9 +938,9 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; $this.hideFormItems(result) - // console.log($this.$data.head_styledef); + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } else if (action.action_type == "set_dlg_current_edit_attr" ) { @@ -977,63 +980,7 @@ console.log($this.head_styledef); if (data.result) { - var result = data.result; - for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items - .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = - result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = - result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = - result[i].value; - } - } - }); - } - } - - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] - .attr) { - $this.$data.refdatastore[j].value = result[i] - .value; - } - } - } - } + $this.setFormValues(data.result) } } @@ -1069,18 +1016,6 @@ attr: a, value: obj_attr[a] || "", })); - if ($this.refdatastore.length > 0) { - for (var i = 0; i < $this.refdatastore.length; i++) { - if (!req.filter(function(s) { - return $this.refdatastore[i].attr == s.name - }).length) { - req.push({ - 'attr': $this.refdatastore[i].attr, - 'value': $this.refdatastore[i].value - }); - } - } - } var extinfo = enviroment; extinfo.edit_dlg = { @@ -1208,7 +1143,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .DataCls .id, objid: "", @@ -1297,8 +1232,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -1392,24 +1327,18 @@ var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.DataCls.id, + cls_id: this.param.DataCls.id, } }; enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - // console.log(obj_attr); - // var dataInfo={ - // class_id: this.$data.param.DataCls.id, data_obj_id: '', masterclsid: '', - // req: JSON.stringify(req), upfile: JSON.stringify([]), post_data: JSON.stringify({}), - // compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment), - // not_trigger_sys_event: '' - // }; + var dataInfo = { - class_id: this.$data.param.DataCls.id, + class_id: this.param.DataCls.id, class_name: '', master_cls_id: '', master_obj_id: '', @@ -1472,12 +1401,12 @@ } - if (!this.$data.param.After_Btn_Not_Refresh) { + if (!this.param.After_Btn_Not_Refresh) { //鍒锋柊 uni.redirectTo({ url: '../modal/3018_2?param=' + JSON.stringify(this.$data .param) + - "&titlename=" + this.$data.title + "&titlename=" + this.title }); } else { var actionlist = data.action; @@ -1585,10 +1514,10 @@ } } - for (var c = 0; c < $this.$data.head_styledef.form + for (var c = 0; c < $this.head_styledef.form .items .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; + var attr = $this.head_styledef.form.items[c]; // console.log(attr[j].Name+'=='+data[i].attr); //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹� if ($this.head_styledef.form.model[data[i] @@ -1633,32 +1562,13 @@ }); } } - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return data[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(data[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore - .length; j++) { - if ($this.$data.refdatastore[j].attr == data[ - i] - .attr) { - $this.$data.refdatastore[j].value = data[ - i] - .value; - } - } - } } }, hideFormItems(data) { const $this = this data.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items + $this.head_styledef.form.items .forEach( async ( ele, index) => { @@ -1691,8 +1601,8 @@ }); var head_styledef = JSON.parse(JSON.stringify($this.$data .head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; + $this.head_styledef = []; + $this.head_styledef = head_styledef; }, afterOK() { this.saving = true @@ -1710,7 +1620,7 @@ var dataInfo = { ed_type: "0", start_transaction: true, - class_id: this.$data.param.DataCls.id, + class_id: this.param.DataCls.id, class_name: '', event_id: this.after_ok.id, event_name: '', @@ -1764,12 +1674,12 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (!this.$data.param.After_Btn_Not_Refresh) { + if (!this.param.After_Btn_Not_Refresh) { //鍒锋柊 uni.redirectTo({ url: '../modal/3018_2?param=' + JSON.stringify(this.$data .param) + - "&titlename=" + this.$data.title + "&titlename=" + this.title }); } else { var actionlist = data.action; @@ -1936,12 +1846,12 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (!this.$data.param.After_Btn_Not_Refresh) { + if (!this.param.After_Btn_Not_Refresh) { //鍒锋柊 uni.redirectTo({ url: '../modal/3018_2?param=' + JSON.stringify(this.$data .param) + - "&titlename=" + this.$data.title + "&titlename=" + this.title }); } else { var actionlist = data.action; @@ -2020,7 +1930,7 @@ uni.redirectTo({ url: '../modal/3018_2?param=' + JSON.stringify(this .$data.param) + - "&titlename=" + this.$data.title + "&titlename=" + this.title }); }, diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue index 151f653..ce2f174 100644 --- a/pages/modal/3037.vue +++ b/pages/modal/3037.vue @@ -163,7 +163,7 @@ <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> </div> <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" - disabled="true" :maxlength="-1"> + disabled="true" :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" @@ -172,7 +172,7 @@ </p> <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" - disabled="true" :maxlength="-1"> + disabled="true" :maxlength="-1"> <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'"> <a @tap="classAttr_AddRef" :data-classid="attr.RelCls[0].id" :data-classname="attr.RelCls[0].name"><i class="ace-icon fa fa-plus-circle"></i></a> @@ -196,7 +196,8 @@ <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> + <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" + :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" @@ -222,7 +223,8 @@ <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> + <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" + :maxlength="-1"> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" @@ -295,7 +297,8 @@ <!-- 宸﹀彸甯冨眬 --> <p class="tx_title2">{{param.Scan_Code.Name}}:</p> <input type="text" class="attr_field" :value="scanCodeVal" @focus="scan_ontap" @blur="scan_onevent" - :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'" :maxlength="-1"> + :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'" + :maxlength="-1"> <div class="text-right2" v-if="param.Scan_Code.Have_Select_Button==true"> <a @tap="scan_classAttr_extButton()"><i class="ace-icon fa" :class="param.Scan_Code.Img?param.Scan_Code.Img:'fa-plus-circle'"></i></a> @@ -512,8 +515,8 @@ <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :value="attr.Value" :style="{'width':attr.Width}" - disabled="true" :maxlength="-1"> + <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" + :maxlength="-1"> </view> <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" @@ -539,8 +542,8 @@ <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input type="text" :value="attr.Value" :style="{'width':attr.Width}" - disabled="true" :maxlength="-1"> + <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" + :maxlength="-1"> </view> <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" @@ -612,9 +615,9 @@ <button type="default" @tap="cancel" class="btn_cancel" v-if="param.Sub_Cls.Can_Add_Delete == true">{{translateSys('cancel')}}</button> - <button type="default" @tap="sava" class="btn_add" + <button type="default" @tap="onSave" class="btn_add" v-if="param.Sub_Cls.Can_Add_Delete == true">{{title}}</button> - <button type="default" @tap="sava" class="btn_sava" + <button type="default" @tap="onSave" class="btn_sava" v-else-if="param.Sub_Cls.Can_Add_Delete == false">{{title}}</button> <!-- 鏅�寮圭獥 top bottom center left right --> @@ -622,9 +625,9 @@ <uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange"> <view class="popup-header">{{check_list.title}}</view> <view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }" - :style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}"> - <view class="popup-cont" - :style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}"> + :style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}"> + <view class="popup-cont" + :style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}"> <view class="view_popup_CheckList" v-for="(item,index) in check_list.items"> <checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check" :data-index="index" :style="{'margin-left': '10rpx'}"> @@ -647,7 +650,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' import utils from "@/js/utils.js" import { @@ -664,12 +669,11 @@ import { classAttrList, } from "@/api/index.js" + import buttonClickMixin from '@/mixins/button-click.js'; export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { pickerAddress }, @@ -699,7 +703,7 @@ title: options.titlename }); //璁剧疆椤堕儴鏍囬 var param = JSON.parse(options.param); - this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 + this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 console.log(param); if (!param.Master_Cls.View_Style) { uni.showModal({ @@ -719,7 +723,7 @@ }); return; } - this.$data.param = param; + this.param = param; // var edit_dlg = { // Model: param.EditDlgMode, // Name: param.Master_Cls.View_Style.Name @@ -732,7 +736,7 @@ let that = this; let keys = []; let val, data; - + Object.keys(obj).forEach(function(key) { keys = key.split("."); val = obj[key]; @@ -749,16 +753,16 @@ }); }); }, - + async loadData() { //涓绘暟鎹被鑾峰彇 const param = this.param - this.$data.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) - this.$data.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls + this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) + this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls ?.View_Style?.Name) this.viewParam('Mast'); - this.$data.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) - this.$data.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style + this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) + this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style ?.Name) this.viewParam('Sub'); }, @@ -851,11 +855,11 @@ var classGridStyle = ''; var classAttrList = ''; if (type == 'Mast') { - classGridStyle = this.$data.classGridStyle; - classAttrList = this.$data.classAttrList; + classGridStyle = this.classGridStyle; + classAttrList = this.classAttrList; } else if (type == 'Sub') { - classGridStyle = this.$data.subClassGridStyle; - classAttrList = this.$data.subClassAttrList; + classGridStyle = this.subClassGridStyle; + classAttrList = this.subClassAttrList; } var class_gridStyle = { ID: classGridStyle.id, @@ -947,31 +951,31 @@ }); if (type == 'Mast') { - this.$data.classGridStyle = class_gridStyle; - this.$data.classAttrList = class_attrList; + this.classGridStyle = class_gridStyle; + this.classAttrList = class_attrList; // console.log('------Mast--------'); - // console.log(this.$data.classGridStyle); - // console.log(this.$data.classAttrList); + // console.log(this.classGridStyle); + // console.log(this.classAttrList); this.class_attr_init(); } else if (type == 'Sub') { - this.$data.subClassGridStyle = class_gridStyle; - this.$data.subClassAttrList = class_attrList; + this.subClassGridStyle = class_gridStyle; + this.subClassAttrList = class_attrList; // console.log('------Sub--------'); - // console.log(this.$data.subClassGridStyle); - // console.log(this.$data.subClassAttrList); + // console.log(this.subClassGridStyle); + // console.log(this.subClassAttrList); this.subClass_attr_init(); } }, class_attr_init() { - var attrlist = this.$data.classGridStyle.StyleDef.show_style; + var attrlist = this.classGridStyle.StyleDef.show_style; var newattrlist = []; - if (this.$data.classAttrList.length > 0) { + if (this.classAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - for (var s = 0; s < this.$data.classAttrList.length; s++) { - var clsattr = this.$data.classAttrList[s]; + for (var s = 0; s < this.classAttrList.length; s++) { + var clsattr = this.classAttrList[s]; // if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -1044,25 +1048,25 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.classGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith, - Font: this.$data.classGridStyle.StyleDef.Font ? this.$data.classGridStyle.StyleDef + control_style: this.classGridStyle.StyleDef.control_style, + title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith, + Font: this.classGridStyle.StyleDef.Font ? this.classGridStyle.StyleDef .Font : {}, - Bk_Color: this.$data.classGridStyle.StyleDef.Bk_Color ? this.$data.classGridStyle + Bk_Color: this.classGridStyle.StyleDef.Bk_Color ? this.classGridStyle .StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.$data.classGridStyle.StyleDef.Text_Color ? this.$data + Text_Color: this.classGridStyle.StyleDef.Text_Color ? this.$data .classGridStyle.StyleDef.Text_Color : '#000000' }); // } } } if (newattrlist.length > 0) { - this.$data.classAttrList = newattrlist; + this.classAttrList = newattrlist; } var req = []; - if (this.$data.classGridStyle.StyleDef) { - if (this.$data.classGridStyle.StyleDef.show_style.length > 0) { - var attrlist = this.$data.classGridStyle.StyleDef.show_style + if (this.classGridStyle.StyleDef) { + if (this.classGridStyle.StyleDef.show_style.length > 0) { + var attrlist = this.classGridStyle.StyleDef.show_style // $el.find('.attr_field').prop('readonly', true); // $el.find('.attr_field').prop('disabled', true); for (var i = 0; i < attrlist.length; i++) { @@ -1078,24 +1082,24 @@ } } - var eventlist = this.$data.classGridStyle.StyleDef.event; + var eventlist = this.classGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } // console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -1103,14 +1107,14 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } this.ini_DataObjRunCustomEvent(info); } - console.log(this.$data.classGridStyle); - console.log(this.$data.classAttrList); + console.log(this.classGridStyle); + console.log(this.classAttrList); } else { uni.showModal({ @@ -1122,15 +1126,15 @@ } }, subClass_attr_init() { - var attrlist = this.$data.subClassGridStyle.StyleDef.show_style; + var attrlist = this.subClassGridStyle.StyleDef.show_style; var newattrlist = []; - if (this.$data.subClassAttrList.length > 0) { + if (this.subClassAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - for (var s = 0; s < this.$data.subClassAttrList.length; s++) { - var clsattr = this.$data.subClassAttrList[s]; + for (var s = 0; s < this.subClassAttrList.length; s++) { + var clsattr = this.subClassAttrList[s]; // if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -1199,25 +1203,25 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.subClassGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.subClassGridStyle.StyleDef.title_p_wdith, - Font: this.$data.subClassGridStyle.StyleDef.Font ? this.$data.subClassGridStyle + control_style: this.subClassGridStyle.StyleDef.control_style, + title_p_wdith: this.subClassGridStyle.StyleDef.title_p_wdith, + Font: this.subClassGridStyle.StyleDef.Font ? this.subClassGridStyle .StyleDef.Font : {}, - Bk_Color: this.$data.subClassGridStyle.StyleDef.Bk_Color ? this.$data + Bk_Color: this.subClassGridStyle.StyleDef.Bk_Color ? this.$data .subClassGridStyle.StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.$data.subClassGridStyle.StyleDef.Text_Color ? this.$data + Text_Color: this.subClassGridStyle.StyleDef.Text_Color ? this.$data .subClassGridStyle.StyleDef.Text_Color : '#000000' }); // } } } if (newattrlist.length > 0) { - this.$data.subClassAttrList = newattrlist; + this.subClassAttrList = newattrlist; } var req = []; - if (this.$data.subClassGridStyle.StyleDef) { - if (this.$data.subClassGridStyle.StyleDef.show_style.length > 0) { - var attrlist = this.$data.subClassGridStyle.StyleDef.show_style + if (this.subClassGridStyle.StyleDef) { + if (this.subClassGridStyle.StyleDef.show_style.length > 0) { + var attrlist = this.subClassGridStyle.StyleDef.show_style // $el.find('.attr_field').prop('readonly', true); // $el.find('.attr_field').prop('disabled', true); for (var i = 0; i < attrlist.length; i++) { @@ -1233,24 +1237,24 @@ } } - var eventlist = this.$data.subClassGridStyle.StyleDef.event; + var eventlist = this.subClassGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } // console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -1258,14 +1262,14 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Sub_Cls.ID, + clsid: this.param.Sub_Cls.ID, objid: "", attr: req, } this.scan_ini_DataObjRunCustomEvent(info); } - console.log(this.$data.subClassGridStyle); - console.log(this.$data.subClassAttrList); + console.log(this.subClassGridStyle); + console.log(this.subClassAttrList); } else { uni.showModal({ @@ -1278,7 +1282,7 @@ }, scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this; - var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event; + var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; if (!Before_Select_Event) { uni.showModal({ title: this.translateSys('tip') + "", @@ -1289,7 +1293,7 @@ return; } var mast_attr = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1308,7 +1312,7 @@ } var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var sub_req = []; for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { @@ -1363,19 +1367,19 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } @@ -1389,7 +1393,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: [], global_attr: req, @@ -1407,15 +1411,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -1423,7 +1427,7 @@ }, popup_sava(e) { //寮规纭畾 閫夋嫨鎸夐挳鍚� var $this = this; - var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event; + var After_Select_Event = $this.param.Scan_Code.After_Select_Event; if (!After_Select_Event) { uni.showModal({ title: this.translateSys('tip') + "", @@ -1433,7 +1437,7 @@ }); return; } - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -1457,7 +1461,7 @@ return; } var mast_attr = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1475,7 +1479,7 @@ } } - $this.$data.scanCodeVal = name; + $this.scanCodeVal = name; var info = { eventid: After_Select_Event.ID, edtype: "7", @@ -1505,16 +1509,16 @@ }, panel_del(index) { var $this = this; - if (this.$data.subPanelList[index].scanCodeVal == this.$data.scanCodeVal) { - this.$data.scanCodeVal = ''; + if (this.subPanelList[index].scanCodeVal == this.scanCodeVal) { + this.scanCodeVal = ''; } - if (!this.$data.subPanelList[index].ObjID) - this.$data.subPanelList.splice(index, 1); + if (!this.subPanelList[index].ObjID) + this.subPanelList.splice(index, 1); else { var dataInfo = { - class_id: this.$data.param.Sub_Cls.ID, + class_id: this.param.Sub_Cls.ID, class_name: '', - obj_id: this.$data.subPanelList[index].ObjID + obj_id: this.subPanelList[index].ObjID }; // console.log(dataInfo); // return; @@ -1524,7 +1528,7 @@ dataObjDel(dataInfo).then(success => { // console.log(success); uni.hideLoading(); - $this.$data.subPanelList.splice(index, 1); + $this.subPanelList.splice(index, 1); uni.showModal({ title: this.translateSys('tip') + "", content: "鍒犻櫎鎴愬姛锛�, @@ -1548,23 +1552,23 @@ //console.log(e.target) getApp().onScan((result) => { //console.log(result.decodedata); - var isVal = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Value; // if(!isVal){ - // this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; - // var isVald =this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; + // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; + // var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; // return; // } //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 if (isVal != result.decodedata) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Value = result.decodedata; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var req = []; - var attrlist = this.$data.classAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.classAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1579,7 +1583,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -1598,18 +1602,18 @@ //console.log(e.target) getApp().onScan((result) => { //console.log(result.decodedata); - var isVal = this.$data.subClassAttrList[e.target.dataset['index']].Attr[e + var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e .target.dataset['iindex']].Value; //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 if (isVal != result.decodedata) { - this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target + this.subClassAttrList[e.target.dataset['index']].Attr[e.target .dataset['iindex']].Value = result.decodedata; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var req = []; - var attrlist = this.$data.subClassAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.subClassAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1624,7 +1628,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -1644,19 +1648,19 @@ getApp().onScan((result) => { console.log(result.decodedata); var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == result.decodedata) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == result.decodedata) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = result.decodedata; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = result.decodedata; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var mast_req = []; //涓绘暟鎹被灞炴� - var classattrlist = this.$data.classAttrList; + var classattrlist = this.classAttrList; for (var i = 0; i < classattrlist.length; i++) { var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1666,7 +1670,7 @@ } var req = []; //瀛愭暟鎹被灞炴� - var attrlist = this.$data.subClassAttrList; + var attrlist = this.subClassAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1682,13 +1686,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: mast_req, sub_attr: req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1699,21 +1703,21 @@ }, scan_onevent(e) { // console.log(e.target); - if (e.target.value) { + if (e.detail.value) { var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == e.target.value) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == e.detail.value) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = e.target.value; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = e.detail.value; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var mast_req = []; //涓绘暟鎹被灞炴� - var classattrlist = this.$data.classAttrList; + var classattrlist = this.classAttrList; for (var i = 0; i < classattrlist.length; i++) { var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1723,7 +1727,7 @@ } var req = []; //瀛愭暟鎹被灞炴� - var attrlist = this.$data.subClassAttrList; + var attrlist = this.subClassAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1739,13 +1743,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: mast_req, sub_attr: req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1756,54 +1760,54 @@ }, onarrow(index, open) { // console.log(index+'--'+open); - var data_attr = this.$data.classAttrList[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']].Open; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']] + this.subPanelList[e.target.dataset['iiindex']] .subClassAttr[e.target.dataset['index']].Attr[e .target.dataset['iindex']].Value = open == true ? false : true; return; } - this.$data.classAttrList[e.target.dataset['iiindex']] + this.classAttrList[e.target.dataset['iiindex']] .subClassAttr[index].Open = open == true ? false : true; }, ondateTime(e) { //console.log(e.target) - var data_attr = this.$data.classAttrList[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']].Value; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']] + this.subPanelList[e.target.dataset['iiindex']] .subClassAttr[e.target.dataset['index']].Attr[e .target.dataset['iindex']].Value = e.target .value; return; } - this.$data.classAttrList[e.target.dataset['index']].Attr[e - .target.dataset['iindex']].Value = e.target.value; + this.classAttrList[e.target.dataset['index']].Attr[e + .target.dataset['iindex']].Value = e.detail.value; }, onchange(e) { console.log(e.target); - var value = this.$data.classAttrList[e.target.dataset[ + var value = this.classAttrList[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']] - .dictitem[e.target.value]; - var data_attr = this.$data.classAttrList[e.target.dataset[ + .dictitem[e.detail.value]; + var data_attr = this.classAttrList[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']]; // console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']] + this.classAttrList[e.target.dataset['index']] .Attr[e.target.dataset['iindex']].Value = value .Name; - // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.classAttrList[e.target + // console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); + var eventid = this.classAttrList[e.target .dataset['index']].Attr[e.target.dataset[ 'iindex']].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1819,7 +1823,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } @@ -1834,12 +1838,12 @@ // console.log(delvalue); if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i] + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i] .Attr) { if (delvalue[0].attr == this.$data .classAttrList[i].Attr[j].Name) { - this.$data.classAttrList[i].Attr[j] + this.classAttrList[i].Attr[j] .Value = ""; } } @@ -1848,8 +1852,8 @@ for (var v in item) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i] + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i] .Attr) { if (item[v].attr == this.$data .classAttrList[i].Attr[j].Name) { @@ -1859,15 +1863,15 @@ } } var itemvalue = item[v]; - var data_attr = this.$data.classAttrList[index] + var data_attr = this.classAttrList[index] .Attr[iindex]; console.log(data_attr); if (itemvalue.Name != data_attr.Value) { - this.$data.classAttrList[index].Attr[ + this.classAttrList[index].Attr[ iindex].Value = value; - // console.log(this.$data.classAttrList[index].Attr[iindex].Value); - var eventid = this.$data.classAttrList[ + // console.log(this.classAttrList[index].Attr[iindex].Value); + var eventid = this.classAttrList[ index].Attr[iindex].action; if (eventid) { // self.event_no_sub = 1; @@ -1898,7 +1902,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param + clsid: this.param .Master_Cls.ID, objid: "", attr: req, @@ -1910,27 +1914,27 @@ }, sub_onchange(e) { console.log(e.target); - var value = this.$data.subPanelList[e + var value = this.subPanelList[e .target.dataset['iiindex']] .subClassAttr[e.target.dataset[ 'index']].Attr[e.target.dataset[ 'iindex']].dictitem[e.target .value]; - var data_attr = this.$data.subPanelList[e + var data_attr = this.subPanelList[e .target.dataset['iiindex']] .subClassAttr[e.target.dataset[ 'index']].Attr[e.target.dataset[ 'iindex']]; // console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.subPanelList[e.target + this.subPanelList[e.target .dataset['iiindex']] .subClassAttr[e.target.dataset[ 'index']].Attr[e.target .dataset['iindex']].Value = value.Name; - // console.log(this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.subPanelList[e + // console.log(this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); + var eventid = this.subPanelList[e .target.dataset['iiindex']] .subClassAttr[e.target.dataset[ 'index']].Attr[e.target @@ -1958,7 +1962,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param + clsid: this.param .Sub_Cls.ID, objid: "", attr: req, @@ -1972,7 +1976,7 @@ // console.log(item); // console.log(value); // console.log(delvalue); - var subClassAttr = this.$data.subPanelList[ + var subClassAttr = this.subPanelList[ e.target.dataset['iiindex']] .subClassAttr; if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value @@ -2055,7 +2059,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param + clsid: this.param .Sub_Cls.ID, objid: "", attr: req, @@ -2068,27 +2072,23 @@ }, onevent(e) { // console.log(e.target); - var data_attr = this.$data.classAttrList[e + var data_attr = this.classAttrList[e .target.dataset['index']].Attr[e .target.dataset['iindex']]; if (!data_attr) { - this.$data.subPanelList[e.target - .dataset['iiindex']] - .subClassAttr[e.target.dataset[ - 'index']].Attr[e.target - .dataset['iindex']].Value = e - .target.value; + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target + .dataset['iindex']].Value = e.detail.value; return; } // console.log(data_attr); - if (e.target.value != data_attr.Value) { - this.$data.classAttrList[e.target + if (e.detail.value != data_attr.Value) { + this.classAttrList[e.target .dataset['index']].Attr[e .target.dataset['iindex']] - .Value = e.target.value; - // var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; + .Value = e.detail.value; + // var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param + var eventid = this.param .Scan_Code.Input_Change_Event.ID; if (eventid) { // self.event_no_sub = 1; @@ -2112,7 +2112,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -2134,11 +2134,11 @@ // console.log(e.target); var ischecked = e.target.dataset.ischeck ? false : true; - var data_attr = this.$data.classAttrList[e + var data_attr = this.classAttrList[e .target.dataset['index']].Attr[e .target.dataset['iindex']]; if (!data_attr) { - this.$data.subPanelList[e.target + this.subPanelList[e.target .dataset['iiindex']] .subClassAttr[e.target.dataset[ 'index']].Attr[e.target @@ -2148,11 +2148,11 @@ } // console.log(data_attr); if (ischecked != data_attr.Value) { - this.$data.classAttrList[e.target + this.classAttrList[e.target .dataset['index']].Attr[e .target.dataset['iindex']] .Value = ischecked; - var eventid = this.$data.classAttrList[ + var eventid = this.classAttrList[ e.target.dataset['index']] .Attr[e.target.dataset['iindex']] .action; @@ -2177,7 +2177,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param + clsid: this.param .Master_Cls.ID, objid: "", attr: req, @@ -2189,12 +2189,12 @@ }, inputValListIsDel(index) { // console.log(index); - this.$data.inputValList.splice(index, + this.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList); + // console.log(this.inputValList); }, addresschange(e) { - this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data + this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data .join(';'); }, classAttr_extButton(index, iindex) { @@ -2223,7 +2223,7 @@ }); return; } - var data_attr = this.$data.classAttrList[ + var data_attr = this.classAttrList[ index].Attr[iindex]; this.DataObjRunCustomEvent_Return( before_click_button, data_attr, @@ -2285,7 +2285,7 @@ attr: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this .DataObjRunCustomEvent( info); @@ -2303,8 +2303,8 @@ showCancel: false, confirmText: this.translateSys('close') }); - // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; - // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; + // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; + // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; }, classAttr_AddPrj(index, iindex) { var param = { @@ -2362,7 +2362,7 @@ attr: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this .DataObjRunCustomEvent( info); @@ -2372,12 +2372,20 @@ } }); }, + onSave() { + this.handleButtonClick((done) => { + this.sava() + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + }, sava() { - if (this.$data.param + if (this.param .Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈� this.scan_OKDataObjRunCustomEvent(this .$data.param.Before_OK_Event.ID); - else if (this.$data.param + else if (this.param .After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈� this.scan_OKDataObjRunCustomEvent(this .$data.param.After_OK_Event.ID); @@ -2392,7 +2400,7 @@ mask: true }); var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -2446,18 +2454,18 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls + cls_id: this.param.Master_Cls .ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Master_Cls.ID, } }; // var dataInfo={ - // class_id: this.$data.param.Master_Cls.ID, data_obj_id: '', masterclsid: '', + // class_id: this.param.Master_Cls.ID, data_obj_id: '', masterclsid: '', // req: JSON.stringify(req), upfile: JSON.stringify([]), post_data: JSON.stringify({}), // compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment), // not_trigger_sys_event: '' @@ -2470,7 +2478,7 @@ .value; }); var dataInfo = { - class_id: this.$data.param + class_id: this.param .Master_Cls.ID, class_name: '', master_cls_id: '', @@ -2542,20 +2550,20 @@ }, ini_DataObjRunCustomEvent(info) { var param = { - EditStyle: this.$data.param + EditStyle: this.param .Master_Cls.View_Style.Name, - ViewStyle: this.$data.param + ViewStyle: this.param .Master_Cls.View_Style.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param + cls_id: this.param .Master_Cls .ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Master_Cls .ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -2851,12 +2859,12 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls + cls_id: this.param.Master_Cls .ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Master_Cls .ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -2864,7 +2872,7 @@ }; enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param + class_id: this.param .Master_Cls.ID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { @@ -2887,12 +2895,12 @@ // var dataInfo = { // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, - // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.$data.global_attr) + // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.global_attr) // } enviroment = Base64.encode(JSON.stringify( enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var global_attr = Base64.encode(JSON - .stringify(this.$data.global_attr) + .stringify(this.global_attr) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON @@ -3316,21 +3324,21 @@ OKDataObjRunCustomEvent() { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls + cls_id: this.param.Master_Cls .ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Master_Cls .ID, // button=bottom鏃�master鐨刢ls_id } }; - var eventid = this.$data.edit_ok_event + var eventid = this.edit_ok_event .scrip_id; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -3343,7 +3351,7 @@ req.push(this.formatAttr(ar)); } } - if (this.$data.refdatastore.length > 0) { + if (this.refdatastore.length > 0) { for (var i = 0; i < this.$data .refdatastore.length; i++) { if (!req.filter(function(s) { @@ -3370,7 +3378,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls + clsid: this.param.Master_Cls .ID, objid: "", attr: req, @@ -3378,12 +3386,12 @@ // var dataInfo = { // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid,rclsid: info.rclsid, // robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, - // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.$data.global_attr) + // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.global_attr) // } enviroment = Base64.encode(JSON.stringify( enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var global_attr = Base64.encode(JSON - .stringify(this.$data.global_attr) + .stringify(this.global_attr) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; info.attr.forEach(item => { @@ -3455,66 +3463,66 @@ showCancel: false, confirmText: this.translateSys('close') }); - - var result = data - .result; - for (var i = 0; i < - result.length; i++ - ) { - // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); - var length = 0; - if (!this.$data - .refdatastore - .filter( - function( - s) { - return result[ - i - ] - .attr == - s - .attr - }).length + if (data.result) { + var result = data + .result; + for (var i = 0; i < + result.length; i++ ) { - length = 1; - this.$data + // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); + var length = 0; + if (!this.$data .refdatastore - .push( - result[ - i] - ); - } - if (length == 0) { - for (var j = - 0; j < this - .$data - .refdatastore - .length; j++ + .filter( + function( + s) { + return result[ + i + ] + .attr == + s + .attr + }).length ) { - if (this - .$data - .refdatastore[ - j] - .attr == - result[ - i] - .attr - ) { - this.$data - .refdatastore[ - j - ] - .value = + length = 1; + this.$data + .refdatastore.push( result[ - i - ] - .value; + i] + ); + } + if (length == 0) { + for (var j = + 0; j < this + .$data + .refdatastore + .length; j++ + ) { + if (this + .$data + .refdatastore[ + j] + .attr == + result[ + i] + .attr + ) { + this.$data + .refdatastore[ + j + ] + .value = + result[ + i + ] + .value; + } } } } - } - this.add(); + this.add(); + } } }).catch(ex => { @@ -3532,19 +3540,19 @@ ) { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls + cls_id: this.param.Master_Cls .ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Master_Cls .ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -3552,7 +3560,7 @@ req.push(this.formatAttr(ar)); } } - if (this.$data.refdatastore.length > 0) { + if (this.refdatastore.length > 0) { for (var i = 0; i < this.$data .refdatastore.length; i++) { if (!req.filter(function(s) { @@ -3575,7 +3583,7 @@ var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param + class_id: this.param .Master_Cls.ID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { @@ -3597,13 +3605,13 @@ } // var dataInfo = { // edtype: "0", eventid: eventid, projectid: '',rclsid: '', robjid: '', userlogin: '', - // clsid: this.$data.param.Master_Cls.ID, objid: '',attr: JSON.stringify(req), - // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.$data.global_attr) + // clsid: this.param.Master_Cls.ID, objid: '',attr: JSON.stringify(req), + // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.global_attr) // } extinfo = Base64.encode(JSON.stringify( extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var global_attr = Base64.encode(JSON - .stringify(this.$data.global_attr) + .stringify(this.global_attr) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; req.forEach(item => { @@ -3614,7 +3622,7 @@ var dataInfo = { ed_type: "0", start_transaction: '', - class_id: this.$data.param.clsid, + class_id: this.param.clsid, class_name: '', event_id: eventid, event_name: '', @@ -3993,19 +4001,19 @@ .value; }); var param = { - EditStyle: this.$data.param.Sub_Cls + EditStyle: this.param.Sub_Cls .View_Style.Name, - ViewStyle: this.$data.param.Sub_Cls + ViewStyle: this.param.Sub_Cls .View_Style.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param + cls_id: this.param .Sub_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param + cls_id: this.param .Sub_Cls .ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -4107,37 +4115,14 @@ if (action_type == 'set_dlg_attr' ) { - if ( - value) { - var val = - value; - if (typeof value == - 'string' - ) { - val = - JSON - .parse( - value - ); + if (value) { + var val = value; + if (typeof value == 'string') { + val = JSON.parse(value); } - console - .log( - val - ); - for ( - var i = - 0; i < - val - .length; i++ - ) { - for ( - var a = - 0; a < - this - .$data - .subClassAttrList - .length; a++ - ) { + console.log(val); + for (var i = 0; i < val.length; i++) { + for (var a = 0; a < this.$data.subClassAttrList.length; a++) { for ( var l = 0; l < @@ -4301,12 +4286,12 @@ } else { enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master: { cls_id: info @@ -4317,7 +4302,7 @@ }; } - var global_attr = this.$data.global_attr; + var global_attr = this.global_attr; if (info.global_attr) { global_attr = info.global_attr; } @@ -4331,7 +4316,7 @@ ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 } var global_attr = Base64.encode(JSON - .stringify(this.$data.global_attr) + .stringify(this.global_attr) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (!info.eventid.includes('{')) info @@ -4856,7 +4841,7 @@ } } - // $this.$data.subPanelList[s].subClassAttr=list_1; + // $this.subPanelList[s].subClassAttr=list_1; } } @@ -5140,7 +5125,7 @@ }); var $this = this; var req = []; - var attrlist = $this.$data.classAttrList; + var attrlist = $this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -5251,15 +5236,15 @@ } var dataJson = { master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, input_3037: $this.$data .scanCodeVal, //鎵爜鍐呭 - op_type: $this.$data.param + op_type: $this.param .OperationType, //浣滀笟绫诲瀷瀹氫箟 sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } }; @@ -5267,14 +5252,14 @@ // var dataInfo = { // edtype: "7", eventid: eventID, projectid: '',rclsid: '', robjid: '', userlogin: '', // clsid: 'MBOX', objid: '',attr: JSON.stringify([]), extinfo: JSON.stringify([]), - // global_attr: JSON.stringify($this.$data.global_attr),dataJson:JSON.stringify(dataJson) + // global_attr: JSON.stringify($this.global_attr),dataJson:JSON.stringify(dataJson) // } // console.log(JSON.stringify(dataInfo)); var dataJson = Base64.encode(JSON .stringify(dataJson) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var global_attr = Base64.encode(JSON - .stringify(this.$data.global_attr) + .stringify(this.global_attr) ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (!eventID.includes('{')) eventID = '{' + eventID + '}'; @@ -5609,7 +5594,7 @@ margin-top: 50rpx; padding: 20rpx; line-height: 1.5; - /* background: #27A6E1; + /* background: #27A6E1; border: none; color: #fff; */ background: #fff; @@ -5775,7 +5760,7 @@ margin-top: 50rpx; padding: 15rpx; line-height: 1.5; - /* background: #27A6E1; + /* background: #27A6E1; border: none; color: #fff; */ background: #fff; diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index a8d0c38..b2cb137 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -1,8 +1,9 @@ <template> <view class="uni-page-modal-3017-2"> <!-- 琛ㄥご鏍峰紡 --> - <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @focus="ontap" @change="onEnterChange" - @click-prefix="classAttr_extButton" @click-suffix="classAttr_extButton"></OIForm> + <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @on-focus="ontap" + @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton"> + </OIForm> <!-- 浠庢暟鎹�--> <view class="v-panel"> <div class="panel_title">{{param.Sub_Cls.Title}}</div> @@ -46,9 +47,9 @@ <view class="view-floor"> <button type="default" @tap="cancel" class="btn_cancel" v-if="param.Sub_Cls.Can_Add_Delete == true">{{translateSys('cancel')}}</button> - <button type="default" @tap="sava" class="btn_add" v-if="param.Sub_Cls.Can_Add_Delete == true" + <button type="default" @tap="onSave" class="btn_add" v-if="param.Sub_Cls.Can_Add_Delete == true" :class="saving?'btn_disabled':''" :disabled="saving">{{title}}</button> - <button type="default" @tap="sava" class="btn_sava" v-else-if="param.Sub_Cls.Can_Add_Delete == false" + <button type="default" @tap="onSave" class="btn_sava" v-else-if="param.Sub_Cls.Can_Add_Delete == false" :class="saving?'btn_disabled':''" :disabled="saving">{{title}}</button> </view> <!-- 鏅�寮圭獥 top bottom center left right --> @@ -81,7 +82,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import utils from "@/js/utils.js" import { appGetInfo, @@ -95,11 +98,10 @@ } from "@/api/data.js" import dayjs from "dayjs"; import OIForm from '@/components/oi-form/index.vue' + import buttonClickMixin from '@/mixins/button-click.js'; export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm }, @@ -137,8 +139,8 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); + this.title = options.titlename; + this.param = JSON.parse(options.param); this.loadData(options.paramValue) //椤甸潰鍒濆鍖栬幏鍙栫劍鐐�@@ -167,14 +169,14 @@ }); }, async loadData(paramValue) { - console.log(this.$data.param); + console.log(this.param); //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁� await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID); //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -196,7 +198,7 @@ }) } - await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID); + await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID); }, async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� var $this = this; @@ -215,8 +217,8 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.head_styledef = result.style_def ? JSON.parse(styledef) : {}; - // console.log($this.$data.head_styledef); + $this.head_styledef = result.style_def ? JSON.parse(styledef) : {}; + // console.log($this.head_styledef); if ($this.head_styledef.form?.items) { $this.head_styledef.form.items.forEach(async (ele, index) => { ele.show = true; @@ -277,8 +279,8 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail1_styledef.SelBut_Checked = true; + $this.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail1_styledef.SelBut_Checked = true; if ($this.detail1_styledef.form?.items) { $this.detail1_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 @@ -348,7 +350,7 @@ $this.head_styledef.form.model[attr] = itemName; } $this.head_styledef.form.items[index].dict = list; - // console.log($this.$data.detail1StyleDefList); + // console.log($this.detail1StyleDefList); } else { if (itemName) { $this.detail1_styledef.form.items[index].value = itemName; @@ -356,7 +358,7 @@ $this.detail1_styledef.form.model[attr] = itemName; } $this.detail1_styledef.form.items[index].dict = list; - console.log($this.$data.detail1_styledef); + console.log($this.detail1_styledef); } } catch (ex) { @@ -500,16 +502,16 @@ } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -539,13 +541,13 @@ }); var style_def = JSON.parse(JSON.stringify(styledef)); if (type == 'head') { - $this.$data.head_styledef = []; - $this.$data.head_styledef = style_def; - // console.log($this.$data.head_styledef); + $this.head_styledef = []; + $this.head_styledef = style_def; + // console.log($this.head_styledef); } else { - $this.$data.detail1_styledef = []; - $this.$data.detail1_styledef = style_def; - // console.log($this.$data.detail1_styledef); + $this.detail1_styledef = []; + $this.detail1_styledef = style_def; + // console.log($this.detail1_styledef); } } else { uni.showModal({ @@ -587,7 +589,7 @@ console.log(item); item.value = result.decodedata let newVal = item.value.trim() - if (item.oldvalue != newVal) { + if (newVal) { item.oldvalue = newVal; var attr = item.fieldId; $this.head_styledef.form.model[attr] = newVal; @@ -599,7 +601,7 @@ }, 1000); // },500); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var obj_attr = this.head_styledef.form.model; // console.log(obj_attr); @@ -614,7 +616,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -636,15 +638,20 @@ let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() - if (!newVal) + if (!newVal) { + item.oldvalue = newVal; + var attr = item.fieldId; + $this.head_styledef.form.model[attr] = newVal; return + } } if (item.oldvalue != newVal) { item.oldvalue = newVal; var attr = item.fieldId; $this.head_styledef.form.model[attr] = newVal; + //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var obj_attr = this.head_styledef.form.model; // console.log(obj_attr); @@ -659,7 +666,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -696,7 +703,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -860,7 +867,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .DataCls .id, objid: "", @@ -949,8 +956,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -1074,20 +1081,20 @@ getApp().onScan((result) => { console.log(result.decodedata); item.value = result.decodedata - let newVal = item.value + let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() } var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == newVal) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == newVal) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal =newVal; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = newVal; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { //涓绘暟鎹被灞炴� var obj_attr = this.head_styledef.form.model; @@ -1109,13 +1116,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: mast_req, sub_attr: req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1126,17 +1133,17 @@ }, scan_onevent(e) { // console.log(e.target); - if (e.target.value) { + if (e.detail.value) { var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == e.target.value) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == e.detail.value) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = e.target.value; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = e.detail.value; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { //涓绘暟鎹被灞炴� var obj_attr = this.head_styledef.form.model; @@ -1165,13 +1172,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: mast_req, sub_attr: req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1183,16 +1190,16 @@ panel_del(index) { //闈㈡澘鍒犻櫎 var $this = this; - if (this.$data.subPanelList[index].scanCodeVal == this.$data.scanCodeVal) { - this.$data.scanCodeVal = ''; + if (this.subPanelList[index].scanCodeVal == this.scanCodeVal) { + this.scanCodeVal = ''; } - if (!this.$data.subPanelList[index].ObjID) - this.$data.subPanelList.splice(index, 1); + if (!this.subPanelList[index].ObjID) + this.subPanelList.splice(index, 1); else { var dataInfo = { - class_id: this.$data.param.Sub_Cls.ID, + class_id: this.param.Sub_Cls.ID, class_name: '', - obj_id: this.$data.subPanelList[index].ObjID + obj_id: this.subPanelList[index].ObjID }; // console.log(dataInfo); // return; @@ -1203,7 +1210,7 @@ // console.log(success); uni.hideLoading(); - $this.$data.subPanelList.splice(index, 1); + $this.subPanelList.splice(index, 1); uni.showModal({ title: this.translateSys("tip"), content: this.translate("delete_success"), @@ -1225,7 +1232,7 @@ }, scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this; - var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event; + var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; if (!Before_Select_Event) { uni.showModal({ title: this.translateSys("tip"), @@ -1242,7 +1249,7 @@ value: obj_attr[a] || "", })); var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var detail_attr = {}; subPanelList[s].subClassAttr.form.items.forEach(item => { @@ -1266,19 +1273,19 @@ var req = []; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: mast_attr }, sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } @@ -1291,7 +1298,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: [], global_attr: req, @@ -1309,15 +1316,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -1325,7 +1332,7 @@ }, popup_sava(e) { //寮规纭畾 閫夋嫨鎸夐挳鍚� var $this = this; - var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event; + var After_Select_Event = $this.param.Scan_Code.After_Select_Event; if (!After_Select_Event) { uni.showModal({ title: this.translateSys("tip"), @@ -1335,7 +1342,7 @@ }); return; } - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -1365,7 +1372,7 @@ value: obj_attr[a] || "", })); - $this.$data.scanCodeVal = name; + $this.scanCodeVal = name; var info = { eventid: After_Select_Event.ID, edtype: "7", @@ -1399,17 +1406,17 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d + class_id: this.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1425,10 +1432,10 @@ // var dataInfo = { // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, - // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.$data.global_attr) + // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.global_attr) // } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -1536,8 +1543,8 @@ } } } - for (var c = 0; c < $this.$data.head_styledef.form.items.length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; + for (var c = 0; c < $this.head_styledef.form.items.length; c++) { + var attr = $this.head_styledef.form.items[c]; // console.log(attr[j].Name+'=='+result[i].attr); if (attr.name != 'Layout') { if (attr.fieldId == result[i].attr) { @@ -1565,16 +1572,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1582,7 +1589,7 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; result.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items.forEach(async (ele, + $this.head_styledef.form.items.forEach(async (ele, index) => { //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗� if (ele.name != 'Layout') { @@ -1602,12 +1609,12 @@ } }); }); - var head_styledef = JSON.parse(JSON.stringify($this.$data.head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; - // console.log($this.$data.head_styledef); + var head_styledef = JSON.parse(JSON.stringify($this.head_styledef)); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } } @@ -1616,8 +1623,8 @@ if (data.result) { var result = data.result; for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items.length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; + for (var c = 0; c < $this.head_styledef.form.items.length; c++) { + var attr = $this.head_styledef.form.items[c]; if (attr.name != 'Layout') { if (attr.fieldId == result[i].attr) { attr.value = ''; @@ -1644,16 +1651,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1683,12 +1690,12 @@ } else { enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master: { cls_id: info.clsid, // button=bottom鏃�master鐨刢ls_id @@ -1698,7 +1705,7 @@ }; } - var global_attr = this.$data.global_attr; + var global_attr = this.global_attr; if (info.global_attr) { global_attr = info.global_attr; } @@ -1708,7 +1715,7 @@ if (info.inputParamter) { info.inputParamter = Base64.encode(JSON.stringify(info.inputParamter)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 } - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}'; var dataInfo = { @@ -1776,10 +1783,10 @@ var result = action.value; for (var i = 0; i < result.length; i++) { if (result[i].choice_list) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - for (var c = 0; c < $this.$data.subPanelList[s] + for (var s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s] .subClassAttrList.length; c++) { - var attr = $this.$data.subPanelList[s].subClassAttrList[c] + var attr = $this.subPanelList[s].subClassAttrList[c] .Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { @@ -1804,10 +1811,10 @@ } } } - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList + for (var s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s].subClassAttrList .length; c++) { - var attr = $this.$data.subPanelList[s].subClassAttrList[c] + var attr = $this.subPanelList[s].subClassAttrList[c] .Attr; for (var j = 0; j < attr.length; j++) { console.log(attr[j].Name + '==' + result[i].attr); @@ -1822,16 +1829,16 @@ } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1841,19 +1848,19 @@ } else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规 var $this = this; if (action.value.common_dlg_id == 'check_list') { - $this.$data.check_list = action.value.config; + $this.check_list = action.value.config; if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.$data.popupType = 'right'; + $this.popupType = 'right'; else - $this.$data.popupType = 'center' + $this.popupType = 'center' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.$data.popupType); + $this.$refs.popup.open($this.popupType); } } else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹� var result = action.value; var $this = this; - var list_1 = JSON.parse(JSON.stringify(this.$data.detail1_styledef)); - var scanCodeVal = $this.$data.scanCodeVal; + var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef)); + var scanCodeVal = $this.scanCodeVal; var rand = ''; for (var i = 0; i < 5; i++) { //鐢熸垚5浣嶉殢鏈烘暟 rand += Math.floor(Math.random() * 10); @@ -1866,7 +1873,7 @@ if (info.attr[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹� scanCodeVal = "mast_input_3037-" + rand; } - $this.$data.subPanelList.push({ + $this.subPanelList.push({ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); @@ -1874,11 +1881,11 @@ active: false }); for (var i = 0; i < result.length; i++) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - if ($this.$data.subPanelList[s].scanCodeVal == scanCodeVal) { + for (var s = 0; s < $this.subPanelList.length; s++) { + if ($this.subPanelList[s].scanCodeVal == scanCodeVal) { if (result[i].attr == "S_ID") - $this.$data.subPanelList[s].ObjID = result[i].value; - var _subClassAttr = $this.$data.subPanelList[s].subClassAttr + $this.subPanelList[s].ObjID = result[i].value; + var _subClassAttr = $this.subPanelList[s].subClassAttr .form.items; for (var c = 0; c < _subClassAttr.length; c++) { if (_subClassAttr[c].name != 'Layout') { @@ -1894,21 +1901,21 @@ } } - // $this.$data.subPanelList[s].subClassAttr=list_1; + // $this.subPanelList[s].subClassAttr=list_1; } } - // console.log($this.$data.subPanelList); + // console.log($this.subPanelList); var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1928,8 +1935,8 @@ } if (data.result) { - var list_1 = JSON.parse(JSON.stringify(this.$data.detail1_styledef)); - var scanCodeVal = $this.$data.scanCodeVal; + var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef)); + var scanCodeVal = $this.scanCodeVal; var rand = ''; for (var i = 0; i < 5; i++) { //鐢熸垚5浣嶉殢鏈烘暟 rand += Math.floor(Math.random() * 10); @@ -1942,17 +1949,17 @@ if (info.attr[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹� scanCodeVal = "mast_input_3037-" + rand; } - $this.$data.subPanelList.push({ + $this.subPanelList.push({ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); var result = data.result; for (var i = 0; i < result.length; i++) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - if ($this.$data.subPanelList[s].scanCodeVal == scanCodeVal) { + for (var s = 0; s < $this.subPanelList.length; s++) { + if ($this.subPanelList[s].scanCodeVal == scanCodeVal) { if (result[i].attr == "S_ID") - $this.$data.subPanelList[s].ObjID = result[i].value; - var _subClassAttr = $this.$data.subPanelList[s].subClassAttr.form + $this.subPanelList[s].ObjID = result[i].value; + var _subClassAttr = $this.subPanelList[s].subClassAttr.form .items; for (var c = 0; c < _subClassAttr.length; c++) { if (_subClassAttr[c].name != 'Layout') { @@ -1971,16 +1978,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1998,13 +2005,20 @@ }); }); }, - + onSave() { + this.handleButtonClick((done) => { + this.sava() + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + }, //纭畾 sava() { - if (this.$data.param.Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�- this.scan_OKDataObjRunCustomEvent(this.$data.param.Before_OK_Event.ID); - else if (this.$data.param.After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�- this.scan_OKDataObjRunCustomEvent(this.$data.param.After_OK_Event.ID); + if (this.param.Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�+ this.scan_OKDataObjRunCustomEvent(this.param.Before_OK_Event.ID); + else if (this.param.After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�+ this.scan_OKDataObjRunCustomEvent(this.param.After_OK_Event.ID); else uni.navigateBack({ delta: 1 @@ -2026,7 +2040,7 @@ })); var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var detail_attr = {}; subPanelList[s].subClassAttr.form.items.forEach(item => { @@ -2049,19 +2063,19 @@ var dataJson = { master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, - input_3037: $this.$data.scanCodeVal, //鎵爜鍐呭 - op_type: $this.$data.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 + input_3037: $this.scanCodeVal, //鎵爜鍐呭 + op_type: $this.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } }; // console.log(JSON.stringify(dataJson)); var dataJson = Base64.encode(JSON.stringify(dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (!eventID.includes('{')) eventID = '{' + eventID + '}'; var dataInfo = { ed_type: "7", @@ -2121,13 +2135,13 @@ }); var result = data.result; - if (eventID != $this.$data.param.After_OK_Event.ID) - $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); + if (eventID != $this.param.After_OK_Event.ID) + $this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID); else { //鍒锋柊 uni.redirectTo({ - url: '../modal/3037_2?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title + url: '../modal/3037_2?param=' + JSON.stringify($this.param) + + "&titlename=" + $this.title }); } } diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue index 9427d83..e33cbc5 100644 --- a/pages/modal/3200.vue +++ b/pages/modal/3200.vue @@ -2,8 +2,8 @@ <view class="uni-page-modal-3200"> <view class="v-content"> <!-- 琛ㄥご鏍峰紡 --> - <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @focus="ontap" - @change="onEnterChange" @click-prefix="onEnterChange" @click-suffix="onEnterChange"></OIForm> + <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @on-focus="ontap" + @on-change="onEnterChange" @on-click-prefix="onEnterChange" @on-click-suffix="onEnterChange"></OIForm> <view class="v-scroll-view"> <scroll-view :scroll-top="scrollTop" :scroll-y="true" class="scroll-y" @scrolltolower="scrolltolower" @scroll="scroll"> @@ -55,7 +55,7 @@ <view class="uni-padding-wrap" v-if="param.ListPage.Page_Button.length>0"> <view class="uni-btn-v"> <a @tap="actionSheetTap"> - <Icon class="mobox-normal-more" /> + <text class="mobox-normal-more" /> </a> </view> </view> @@ -64,7 +64,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import classUtils from "@/js/utils.js" import { appGetInfo, @@ -78,11 +80,10 @@ } from "@/api/data.js" import dayjs from "dayjs"; import OIForm from '@/components/oi-form/index.vue' + import buttonClickMixin from '@/mixins/button-click.js'; export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm }, @@ -152,8 +153,8 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); + this.title = options.titlename; + this.param = JSON.parse(options.param); this.styledef = {}; @@ -211,7 +212,7 @@ // this.query_id = ""; // await this.loadDataGetList(); // } - // console.log(this.$data.param); + // console.log(this.param); //椤甸潰鍒濆鍖栬幏鍙栫劍鐐� // this.focusMateria=true; }, @@ -251,7 +252,7 @@ //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -323,9 +324,9 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.head_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.head_styledef = result.style_def ? JSON.parse(styledef) : {}; // this.form = this.head_styledef.form.model; - // console.log($this.$data.head_styledef); + // console.log($this.head_styledef); if ($this.head_styledef.form?.items) { $this.head_styledef.form.items.forEach(async (ele, index) => { console.log(ele.useDict); @@ -382,8 +383,8 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail1_styledef.SelBut_Checked = false; + $this.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail1_styledef.SelBut_Checked = false; } catch (ex) { // console.log(ex); let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex @@ -735,7 +736,7 @@ //鍒锋柊褰撳墠椤甸潰 this.initial(); // uni.redirectTo({ - // url:'../modal/3200?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title, + // url:'../modal/3200?param='+JSON.stringify(this.param)+"&titlename="+this.title, // }); }, //鐐瑰嚮鏄剧ず娴忚瀵硅薄鏄剧ず椤甸潰 @@ -808,7 +809,14 @@ } } }); - } else that.onButtonClicked(btn, style); + } else { + this.handleButtonClick((done) => { + that.onButtonClicked(btn, style); + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + } }, //鐐瑰嚮鎸夐挳鍒楄〃 actionSheetTap() { @@ -1287,7 +1295,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.head_styledef.form.clsId, + class_id: this.head_styledef.form.clsId, class_name: '', event_id: event.id, event_name: '', diff --git a/pages/modal/3200_view.vue b/pages/modal/3200_view.vue index d10f7d2..f8c0970 100644 --- a/pages/modal/3200_view.vue +++ b/pages/modal/3200_view.vue @@ -4,12 +4,8 @@ <view class="dv-panel dv-panel-bkcolor"> <div class="dv-panel-input"> <!-- HTML椤甸潰绫诲瀷鏄剧ず --> - <div class="dv-viewHtml-Panel" v-if="ViewHtml_Panel" v-html="ViewHtml_Panel"> - <!-- <div> - <label class="item-label">浠诲姟缂栫爜:</label> - <span class="item-span">TA240318-00005</span> - </div> --> - </div> + <view class="dv-viewHtml-Panel" v-if="ViewHtml_Panel" v-html="ViewHtml_Panel"></view> + <!-- 鑷畾涔夎〃鍗曠被鍨嬫樉绀�--> <div v-if="!ViewHtml_Panel"> <OIForm :form="detail2_styledef.form.items" viewMode></OIForm> @@ -29,7 +25,7 @@ <view class="uni-padding-wrap" v-if="param.ViewPage.Page_Button.length>2"> <view class="uni-btn-v"> <a @tap="actionSheetTap"> - <Icon class="mobox-normal-more" /> + <text class="mobox-normal-more" /> </a> </view> </view> @@ -38,7 +34,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import classUtils from "@/js/utils.js" import { appGetInfo, @@ -50,17 +48,16 @@ dataObjQuery } from "@/api/data.js" import OIForm from '@/components/oi-form/index.vue' - + import buttonClickMixin from '@/mixins/button-click.js'; + export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm }, onBackPress(e) { // console.log("鐩戝惉杩斿洖鎸夐挳浜嬩欢",e); - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit('ExitViewEvent', ""); // uni.navigateBack({ @@ -99,11 +96,11 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); - console.log(this.$data.param); - this.$data.styleDef = JSON.parse(options.style); - // console.log(this.$data.styleDef); + this.title = options.titlename; + this.param = JSON.parse(options.param); + console.log(this.param); + this.styleDef = JSON.parse(options.style); + // console.log(this.styleDef); if (this.param.ViewPage.View_UIDef.ui_type == "HTML椤甸潰") { // HTML椤甸潰 //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰 @@ -184,9 +181,9 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail2_styledef.SelBut_Checked = false; - // console.log($this.$data.detail2_styledef); + $this.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail2_styledef.SelBut_Checked = false; + // console.log($this.detail2_styledef); if ($this.detail2_styledef.form?.items) { $this.styleDef.form.attrs.forEach((attr) => { // info[attr.name]=attr.value; @@ -353,7 +350,15 @@ } } }); - } else that.onButtonClicked(btn); + } else{ + this.handleButtonClick((done) => { + that.onButtonClicked(btn); + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + + } }, //鐐瑰嚮鎸夐挳鍒楄〃 actionSheetTap() { @@ -490,7 +495,7 @@ result.action.forEach(item => { if (item.action_type == "goback_to_pre_page") { //杩斿洖涓婁竴椤� var value = item.value; - // const eventChannel = this.$scope.eventChannel; + // const eventChannel = this.getOpenerEventChannel(); // // const eventChannel = this.getOpenerEventChannel(); // eventChannel.emit('ExitViewEvent',""); uni.navigateBack({ @@ -700,7 +705,7 @@ }, cancel(e) { //鍙栨秷 - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit('ExitViewEvent', ""); uni.navigateBack({ diff --git a/pages/modal/3201.vue b/pages/modal/3201.vue index 0cd45ef..a2cefb1 100644 --- a/pages/modal/3201.vue +++ b/pages/modal/3201.vue @@ -31,7 +31,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import classUtils from "@/js/utils.js" import { appGetInfo, @@ -43,11 +45,10 @@ dataObjQuery, } from "@/api/data.js" - + import buttonClickMixin from '@/mixins/button-click.js'; + export default { - modules: { - Base64, - }, + mixins: [buttonClickMixin], data() { return { title: '3201棣栭〉', @@ -95,19 +96,19 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); - console.log(this.$data.param); + this.title = options.titlename; + this.param = JSON.parse(options.param); + console.log(this.param); //鍔犺浇鍒濆鐣岄潰 - if (this.$data.param.welcome_page) { - this.$data.styles.width = this.$data.param.welcome_page.width + 'px'; - this.$data.styles.height = this.$data.param.welcome_page.height + 'px'; - this.$data.styles.backgroundColor = this.$data.param.welcome_page.bkground_color; + if (this.param.welcome_page) { + this.styles.width = this.param.welcome_page.width + 'px'; + this.styles.height = this.param.welcome_page.height + 'px'; + this.styles.backgroundColor = this.param.welcome_page.bkground_color; - this.$data.param.welcome_page.img = this.$data.param.welcome_page.img.replace(/ /g, '+'); - this.$data.param.welcome_page.width = parseInt(this.$data.param.welcome_page.width); - this.$data.param.welcome_page.height = parseInt(this.$data.param.welcome_page.height); - this.$data.param.catalog.forEach(async (ele, index) => { + this.param.welcome_page.img = this.param.welcome_page.img.replace(/ /g, '+'); + this.param.welcome_page.width = parseInt(this.param.welcome_page.width); + this.param.welcome_page.height = parseInt(this.param.welcome_page.height); + this.param.catalog.forEach(async (ele, index) => { ele.img = ele.img.replace(/ /g, '+'); ele.taskQty = 0; await this.appGetInfo(ele.function_def_id, index); @@ -170,8 +171,8 @@ }); return; } - this.$data.param.catalog[index].param = param; - this.$data.param.catalog[index].appName = appName; + this.param.catalog[index].param = param; + this.param.catalog[index].appName = appName; param = JSON.parse(param); $this.orderby = param.Order ? param.Order : 'T_CREATE Desc'; @@ -314,11 +315,11 @@ dataObjQuery(dataInfo).then(result => { // console.log(result); if (result) { - $this.$data.param.catalog[index].taskQty = result.obj_list.length; - // console.log($this.$data.param.catalog[index]); - var catalog = JSON.parse(JSON.stringify($this.$data.param.catalog)); - $this.$data.param.catalog = []; - $this.$data.param.catalog = catalog; + $this.param.catalog[index].taskQty = result.obj_list.length; + // console.log($this.param.catalog[index]); + var catalog = JSON.parse(JSON.stringify($this.param.catalog)); + $this.param.catalog = []; + $this.param.catalog = catalog; } }).catch(ex => { @@ -362,9 +363,9 @@ //鍒锋柊褰撳墠椤甸潰 // location.reload(); // uni.redirectTo({ - // url:'../modal/3201?param='+JSON.stringify($this.$data.param)+"&titlename="+$this.$data.title + // url:'../modal/3201?param='+JSON.stringify($this.param)+"&titlename="+$this.title // }); - $this.$data.param.catalog.forEach(async (ele, index) => { + $this.param.catalog.forEach(async (ele, index) => { ele.taskQty = 0; await $this.appGetInfo(ele.function_def_id, index); }); diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue index b1f2596..4918b6d 100644 --- a/pages/modal/5600.vue +++ b/pages/modal/5600.vue @@ -132,7 +132,7 @@ </div> <div class="dv-panel-button"> <checkbox v-if="param.Sub_Page[1].Select_Button==true" :value="ii" - v-model:checked="style.SelBut_Checked" /> + :checked="style.SelBut_Checked" /> <!-- <text></text> --> <!-- <button type="primary" @click="savaDataObj(style,ii)" v-if="param.Sub_Page[1].OK_Button==true">淇濆瓨</Button> --> @@ -192,7 +192,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import { appGetInfo, dictGetInfo @@ -205,9 +207,6 @@ } from "@/api/data.js" export default { - modules: { - Base64, - }, data() { return { title: this.translateSys("coding_disk"), @@ -241,7 +240,6 @@ global_attr: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} popupType: "center", check_list: {}, popupParam: {}, @@ -252,9 +250,9 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); - // console.log(this.$data.param); + this.title = options.titlename; + this.param = JSON.parse(options.param); + // console.log(this.param); this.loadData(options.paramValue) }, //椤甸潰鍒濆鍖栬幏鍙栫劍鐐�@@ -282,11 +280,11 @@ }, async loadData(paramValue) { //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- await this.Head_UIStyleGetInfo(this.$data.ClsID, this.$data.param.Input_UI_Style.ID); + await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID); //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -309,17 +307,17 @@ } //鍔犺浇鍒濆鐣岄潰 - if (this.$data.param.Show_Welcom_Page) { - this.$data.param.Welcome_Page.Img = this.$data.param.Welcome_Page.Img.replace(/ /g, '+'); - this.$data.param.Welcome_Page.Width = parseInt(this.$data.param.Welcome_Page.Width); - this.$data.param.Welcome_Page.Height = parseInt(this.$data.param.Welcome_Page.Height); + if (this.param.Show_Welcom_Page) { + this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+'); + this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width); + this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height); } //鍔犺浇Tab椤电 - this.$data.items.push(this.$data.param.Sub_Page[0].Name); - this.$data.items.push(this.$data.param.Sub_Page[1].Name); - await this.Detail1_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[0].UI_Style.ID); - await this.Detail2_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[1].UI_Style.ID); - console.log(this.$data.param); + this.items.push(this.param.Sub_Page[0].Name); + this.items.push(this.param.Sub_Page[1].Name); + await this.Detail1_UIstyleGetInfo(this.ClsID, this.param.Sub_Page[0].UI_Style.ID); + await this.Detail2_UIstyleGetInfo(this.ClsID, this.param.Sub_Page[1].UI_Style.ID); + console.log(this.param); }, changeSwiper(evt) { let index = evt.target.current || evt.detail.current; @@ -368,11 +366,11 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.head_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.head_styledef = result.style_def ? JSON.parse(styledef) : {}; // this.form = this.head_styledef.form.model; - // console.log($this.$data.head_styledef); - if ($this.$data.head_styledef.form?.items) { - $this.$data.head_styledef.form.items.forEach(async (ele, index) => { + // console.log($this.head_styledef); + if ($this.head_styledef.form?.items) { + $this.head_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 await this.DictGetInfo(ele.bind.dict, index, 'mast'); } else { @@ -432,13 +430,13 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail1_styledef.SelBut_Checked = true; - // console.log($this.$data.detail1_styledef); - // $this.$data.detail1StyleDefList.push($this.$data.detail1_styledef); + $this.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail1_styledef.SelBut_Checked = true; + // console.log($this.detail1_styledef); + // $this.detail1StyleDefList.push($this.detail1_styledef); // var aa = JSON.stringify(this.detail1_styledef); - // $this.$data.detail1StyleDefList.push(JSON.parse(aa)); - // console.log($this.$data.detail1StyleDefList); + // $this.detail1StyleDefList.push(JSON.parse(aa)); + // console.log($this.detail1StyleDefList); if ($this.detail1_styledef.form?.items) { $this.detail1_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 @@ -490,8 +488,8 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail2_styledef.SelBut_Checked = true; + $this.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail2_styledef.SelBut_Checked = true; } catch (ex) { // console.log(ex); let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex @@ -544,7 +542,7 @@ var detail1_styledef = JSON.parse(JSON.stringify($this.detail1_styledef)); $this.detail1_styledef = []; $this.detail1_styledef = detail1_styledef; - // console.log($this.$data.detail1_styledef); + // console.log($this.detail1_styledef); } } catch (ex) { @@ -688,7 +686,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -791,7 +789,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.head_styledef.form.clsId, + class_id: this.head_styledef.form.clsId, class_name: '', event_id: event.id, event_name: '', @@ -845,17 +843,17 @@ if (result.result_type == 0 && result.action) { result.action.forEach(item => { if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; $this.viewAceionRow(value); } else if (item.action_type == "set_subtable_page_content") { //宸茬爜鐩�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; if (value.clear_confirm != false && value.clear == true && - $this.$data.detail1StyleDefList.length > 0 && - value.page_name == $this.$data.param.Sub_Page[0] + $this.detail1StyleDefList.length > 0 && + value.page_name == $this.param.Sub_Page[0] .Name ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹� uni.showModal({ @@ -883,11 +881,11 @@ } }); } else { - if (value.page_name == $this.$data.param.Sub_Page[ + if (value.page_name == $this.param.Sub_Page[ 0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - $this.$data.detail1StyleDefList = []; + $this.detail1StyleDefList = []; } else { - $this.$data.detail2StyleDefList = []; + $this.detail2StyleDefList = []; } $this.viewAceionContent(value); } @@ -930,7 +928,7 @@ .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� value.row.forEach(row => { - $this.$data.detail1StyleDefList + $this.detail1StyleDefList .forEach((ele, index) => { if (ele.form.objId == row .id) { @@ -947,12 +945,12 @@ } else if (item.action_type == "set_subtable_page_ext_data") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1ExtData: value.ext_data }) - } else if (value.page_name == $this.$data.param + } else if (value.page_name == $this.param .Sub_Page[1].Name) { $this.setData({ detail2ExtData: value.ext_data @@ -960,13 +958,13 @@ } } else if (item.action_type == "clear_subpage_rows") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1StyleDefList: [], detail1ExtData: {} }) - } else if (value.page_name == $this.$data.param + } else if (value.page_name == $this.param .Sub_Page[1].Name) { $this.setData({ detail2StyleDefList: [], @@ -992,7 +990,7 @@ } else if (item.action_type == "set_dlg_attr") { // value = {"attr":"xxx", "value":"xxx"} var data = item.value; - $this.$data.head_styledef.form.items.forEach(async ( + $this.head_styledef.form.items.forEach(async ( ele, index) => { data.forEach(async (ele2, index) => { if (ele.fieldId == ele2 @@ -1103,10 +1101,10 @@ viewActionSetRow(value) { const $this = this var detailStyleDefList = [] - if (value.page_name == $this.$data.param.Sub_Page[1].Name) { - detailStyleDefList = $this.$data.detail2StyleDefList - } else if (value.page_name == $this.$data.param.Sub_Page[0].Name) { - detailStyleDefList = $this.$data.detail1StyleDefList + if (value.page_name == $this.param.Sub_Page[1].Name) { + detailStyleDefList = $this.detail2StyleDefList + } else if (value.page_name == $this.param.Sub_Page[0].Name) { + detailStyleDefList = $this.detail1StyleDefList } detailStyleDefList.forEach(ele => { value.row.forEach((rowData) => { @@ -1200,11 +1198,11 @@ }) }); - if (value.page_name == $this.$data.param.Sub_Page[1].Name) { + if (value.page_name == $this.param.Sub_Page[1].Name) { $this.setData({ detail2StyleDefList: detailStyleDefList }) - } else if (value.page_name == $this.$data.param.Sub_Page[0].Name) { + } else if (value.page_name == $this.param.Sub_Page[0].Name) { $this.setData({ detail1StyleDefList: detailStyleDefList }) @@ -1217,12 +1215,12 @@ if (JSON.stringify(data.row) == '{}') { return; } - var styleStr = JSON.stringify(this.$data.detail1_styledef); + var styleStr = JSON.stringify(this.detail1_styledef); if (type) { //纭畾鍚庤剼鏈繘鍏ュ姞杞藉凡鍒嗘嫞鏁版嵁 - styleStr = JSON.stringify(this.$data.detail2_styledef); + styleStr = JSON.stringify(this.detail2_styledef); } else { - if (data.page_name == this.$data.param.Sub_Page[1].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 - styleStr = JSON.stringify(this.$data.detail2_styledef); //寰呭垎鎷�+ if (data.page_name == this.param.Sub_Page[1].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 + styleStr = JSON.stringify(this.detail2_styledef); //寰呭垎鎷� } } data.row.forEach(row => { @@ -1250,19 +1248,19 @@ }); if (type) { //纭畾鍚庤剼鏈繘鍏ュ姞杞藉凡鍒嗘嫞鏁版嵁 - this.$data.detail2StyleDefList.push(detailStyle); - // console.log(this.$data.detail2StyleDefList); + this.detail2StyleDefList.push(detailStyle); + // console.log(this.detail2StyleDefList); } else { - if (data.page_name == this.$data.param.Sub_Page[1] + if (data.page_name == this.param.Sub_Page[1] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 - this.$data.detail2StyleDefList.push(detailStyle); - // console.log(this.$data.detail2StyleDefList); + this.detail2StyleDefList.push(detailStyle); + // console.log(this.detail2StyleDefList); } else { - this.$data.detail1StyleDefList.push(detailStyle); + this.detail1StyleDefList.push(detailStyle); this.activelist.push({ active: false }); - // console.log(this.$data.detail1StyleDefList); + // console.log(this.detail1StyleDefList); } } } @@ -1279,9 +1277,9 @@ if (JSON.stringify(data.content) == '{}') { return; } - var styleStr = JSON.stringify($this.$data.detail2_styledef); - if (data.page_name == $this.$data.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄爜鐩樹腑 - styleStr = JSON.stringify($this.$data.detail1_styledef); //鐮佺洏涓�+ var styleStr = JSON.stringify($this.detail2_styledef); + if (data.page_name == $this.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄爜鐩樹腑 + styleStr = JSON.stringify($this.detail1_styledef); //鐮佺洏涓� } data.content.forEach(cont => { @@ -1309,7 +1307,7 @@ } }); }); - if (data.page_name == $this.$data.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 + if (data.page_name == $this.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //濡傛灉 clear = false 鍒欎笉闇�娓呴櫎锛屾牴鎹甶d鍒ゆ柇鏄惁瀛樺湪锛屼笉瀛樺湪鎻掑叆鍒伴〉闈紝濡傛灉瀛樺湪鐢ㄦ柊鐨勫睘鎬ц鐩� if (data.clear == false) { var isflag = true; @@ -1343,7 +1341,7 @@ $this.activelist.push({ active: false }); - // console.log($this.$data.detail1StyleDefList); + // console.log($this.detail1StyleDefList); } else { if (data.clear == false) { //濡傛灉 clear = false 鍒欎笉闇�娓呴櫎锛屾牴鎹甶d鍒ゆ柇鏄惁瀛樺湪锛屼笉瀛樺湪鎻掑叆鍒伴〉闈紝濡傛灉瀛樺湪鐢ㄦ柊鐨勫睘鎬ц鐩�@@ -1376,7 +1374,7 @@ $this.detail2StyleDefList.push(detailStyle); //宸插垎鎷� } - //console.log($this.$data.detail2StyleDefList); + //console.log($this.detail2StyleDefList); } } }); @@ -1463,7 +1461,7 @@ async del(style, event) { //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); @@ -1544,7 +1542,7 @@ async del2(style, event) { //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); @@ -1630,7 +1628,7 @@ ele.active = false; }); this.activelist[value].active = true; - // console.log(this.$data.activelist); + // console.log(this.activelist); }, popupChange(e) { console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show); @@ -1639,15 +1637,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -1655,7 +1653,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -1669,7 +1667,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, @@ -1687,7 +1685,7 @@ }); return; } - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -1695,12 +1693,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.ClsID, + clsid: $this.ClsID, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, @@ -1708,18 +1706,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.ClsID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.ClsID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.ClsID, //褰撳墠鏁版嵁绫籭d + class_id: this.ClsID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1735,7 +1733,7 @@ } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var input_param = Base64.encode(JSON.stringify(info.attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -1812,7 +1810,7 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; result.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items + $this.head_styledef.form.items .forEach( async (ele, index) => { @@ -1845,11 +1843,11 @@ }); var head_styledef = JSON.parse(JSON.stringify($this.$data .head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; - // console.log($this.$data.head_styledef); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } else { uni.showModal({ title: this.translateSys("tip"), @@ -1868,64 +1866,8 @@ } console.log($this.head_styledef); if (data.result) { - var result = data.result; - for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items - .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = - result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = - result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = - result[i].value; - } - } - }); - } - } - - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] - .attr) { - $this.$data.refdatastore[j].value = result[i] - .value; - } - } - } + $this.setFormValues( data.result) } - } } }).catch(ex => { @@ -1960,19 +1902,7 @@ attr: a, value: obj_attr[a] || "", })); - if ($this.refdatastore.length > 0) { - for (var i = 0; i < $this.refdatastore.length; i++) { - if (!req.filter(function(s) { - return $this.refdatastore[i].attr == s.name - }).length) { - req.push({ - 'attr': $this.refdatastore[i].attr, - 'value': $this.refdatastore[i].value - }); - } - } - } - + var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�@@ -2102,7 +2032,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .DataCls .id, objid: "", @@ -2190,8 +2120,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -2267,14 +2197,14 @@ this.After_OK_Event = this.param.Sub_Page[0].After_ok; // console.log(this.Before_OK_Event); // console.log(this.After_OK_Event); - if (this.$data.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 - this.sava(this.$data.Before_OK_Event); - else if (this.$data.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 - this.sava(this.$data.After_OK_Event); + if (this.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 + this.sava(this.Before_OK_Event); + else if (this.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 + this.sava(this.After_OK_Event); }, sava(event) { var $this = this; - // if (this.$data.detail1StyleDefList.length == 0) { + // if (this.detail1StyleDefList.length == 0) { // uni.showModal({ // title: this.translateSys("tip"), // content: this.translate( @@ -2292,13 +2222,13 @@ this.okLoading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); //鑾峰彇姝e湪鐮佺洏灞炴� var detailAttrList = []; - this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { var detail_attr = {}; style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -2318,7 +2248,7 @@ }); // console.log(detailAttrList); //鑾峰彇姝e湪鐮佺洏閲屾病鏈夋樉绀虹殑瀛楁 - this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { if (style.form.objId == detailAttrList[key]['id']) { @@ -2382,14 +2312,14 @@ this.After_OK_Event = this.param.Sub_Page[1].After_ok; // console.log(this.Before_OK_Event); // console.log(this.After_OK_Event); - if (this.$data.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 - this.sava2(this.$data.Before_OK_Event); - else if (this.$data.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 - this.sava2(this.$data.After_OK_Event); + if (this.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 + this.sava2(this.Before_OK_Event); + else if (this.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 + this.sava2(this.After_OK_Event); }, sava2(event) { var $this = this; - if (this.$data.detail2StyleDefList.length == 0) { + if (this.detail2StyleDefList.length == 0) { uni.showModal({ title: this.translateSys("tip"), content: this.translate( @@ -2407,13 +2337,13 @@ this.ok2Loading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); //鑾峰彇姝e湪鐮佺洏灞炴� var detailAttrList = []; - this.$data.detail2StyleDefList.forEach(style => { + this.detail2StyleDefList.forEach(style => { var detail_attr = {}; style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -2433,7 +2363,7 @@ }); // console.log(detailAttrList); //鑾峰彇姝e湪鐮佺洏閲屾病鏈夋樉绀虹殑瀛楁 - this.$data.detail2StyleDefList.forEach(style => { + this.detail2StyleDefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { if (style.form.objId == detailAttrList[key]['id']) { @@ -2501,7 +2431,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.ClsID, + class_id: this.ClsID, class_name: '', event_id: event.ID, event_name: '', @@ -2561,19 +2491,19 @@ //鍔犺浇宸茬粡鐮佺洏鏁版嵁 $this.viewAceionRow(value, 'add'); //娓呯┖鏉$爜鍐呭 - $this.$data.head_styledef.form.items.forEach((item, + $this.head_styledef.form.items.forEach((item, index) => { if (item.fieldId != "S_CNTR_CODE") { item.value = ''; item.oldvalue = ''; - $this.$data.head_styledef.form.model[item + $this.head_styledef.form.model[item .fieldId] = ''; } }); //娓呴櫎姝e湪鐮佺洏涓垚鍔熺殑鏁版嵁 - // $this.$data.detail1StyleDefList.forEach((style,index)=>{ + // $this.detail1StyleDefList.forEach((style,index)=>{ // if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){ - // $this.$data.detail1StyleDefList.splice(index,1); + // $this.detail1StyleDefList.splice(index,1); // return; // } // }); @@ -2590,7 +2520,7 @@ // //鍒锋柊褰撳墠椤甸潰 // // location.reload(); // uni.redirectTo({ - // url:'../modal/5600?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title + // url:'../modal/5600?param='+JSON.stringify(this.param)+"&titlename="+this.title // }); // } else if(item.action_type == "prompt"){ //鎵撳紑绯荤粺鎻愮ず寮规 // var value = ''; @@ -2601,12 +2531,12 @@ // uni.showModal({title:"绯荤粺鎻愮ず",content:value,showCancel:false,confirmText:"鍏抽棴"}); } else if (item.action_type == "set_subtable_page_content") { //宸茬爜鐩�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; if (value.clear_confirm != false && value.clear == true && - $this.$data.detail1StyleDefList.length > 0 && - value.page_name == $this.$data.param.Sub_Page[0] + $this.detail1StyleDefList.length > 0 && + value.page_name == $this.param.Sub_Page[0] .Name ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹� uni.showModal({ @@ -2634,11 +2564,11 @@ } }); } else { - if (value.page_name == $this.$data.param.Sub_Page[ + if (value.page_name == $this.param.Sub_Page[ 0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - $this.$data.detail1StyleDefList = []; + $this.detail1StyleDefList = []; } else { - $this.$data.detail2StyleDefList = []; + $this.detail2StyleDefList = []; } $this.viewAceionContent(value); } @@ -2649,7 +2579,7 @@ .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� value.row.forEach(row => { - $this.$data.detail1StyleDefList.forEach(( + $this.detail1StyleDefList.forEach(( ele, index) => { if (ele.form.objId == row.id) { $this.$data @@ -2664,12 +2594,12 @@ } else if (item.action_type == "set_subtable_page_ext_data") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1ExtData: value.ext_data }) - } else if (value.page_name == $this.$data.param.Sub_Page[1] + } else if (value.page_name == $this.param.Sub_Page[1] .Name) { $this.setData({ detail2ExtData: value.ext_data @@ -2677,13 +2607,13 @@ } } else if (item.action_type == "clear_subpage_rows") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1StyleDefList: [], detail1ExtData: {} }) - } else if (value.page_name == $this.$data.param.Sub_Page[1] + } else if (value.page_name == $this.param.Sub_Page[1] .Name) { $this.setData({ detail2StyleDefList: [], @@ -2708,7 +2638,7 @@ } else if (item.action_type == "set_dlg_attr") { // value = {"attr":"xxx", "value":"xxx"} var data = item.value; - $this.$data.head_styledef.form.items.forEach(async ( + $this.head_styledef.form.items.forEach(async ( ele, index) => { data.forEach(async (ele2, index) => { if (ele.fieldId == ele2 @@ -2746,16 +2676,16 @@ } }); } else { - if ($this.$data.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 + if ($this.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 if (type == '1') { - $this.sava($this.$data.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ $this.sava($this.After_OK_Event); //鎵ц纭畾鍚庝簨浠� } else { - $this.sava2($this.$data.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ $this.sava2($this.After_OK_Event); //鎵ц纭畾鍚庝簨浠� } } } } else { - // $this.$data.detail2StyleDefList=[]; + // $this.detail2StyleDefList=[]; if (result.info) { uni.showModal({ title: this.translateSys("tip"), diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue index 3055125..12bcb8e 100644 --- a/pages/modal/5601.vue +++ b/pages/modal/5601.vue @@ -2,8 +2,8 @@ <view class="uni-page-modal-5601"> <!-- 琛ㄥご鏍峰紡 --> <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :focusId="focusFieldId" - @click="onClick" @focus="ontap" @change="onEnterChange" @click-prefix="classAttr_extButton" - @click-suffix="classAttr_extButton"></OIForm> + @on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" + @on-click-suffix="classAttr_extButton"></OIForm> <view class="view-content"> <!-- 鐮佺洏瀛愮晫闈�--> @@ -23,12 +23,11 @@ src="../../images/mobox_log_200x40.png"> </image> <checkbox-group @change="checkboxChange"> - <div class="dv-panel" v-for="(style,ii) in pageData.DefList" + <div class="dv-panel" v-for="(style,ii) in pageData.DefList" :key="ii" @tap="onPanelClick(ii,style.form.htmlobjId)" :id="'dvpanel'+style.form.htmlobjId" :class="style.form.htmlobjId==active_id?'bk-active':''"> <OIForm class="dv-panel-form" :form="style.form" viewMode></OIForm> - <div class="dv-panel-button" v-if="pageData.Select_Button==true || pageData.Row_Button.length > 0"> @@ -40,8 +39,8 @@ :key="btnIndex" type="default" :class="btn.FunCode == 'Delete' ? 'btn-warn' : 'btn-primary'" @click="onRowBtnClick(btn, pageData,ii)"> - <Icon v-if="btn.Style == 'img' || btn.Style == 'img_text'" - class="Img" /> + <text v-if="btn.Style == 'img' || btn.Style == 'img_text'" + class="Img"></text> {{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}} </button> </div> @@ -51,21 +50,18 @@ </view> <view class="view-bottom" v-if="pageData.Button.length >0 "> <button v-for="(btn,btnIndex) in pageData.Button" :key="btnIndex" type="default" - :class="{'btn-disabled':(btn.FunCode != 'Cancel' && pageData.okLoading), - 'btn-primary':(btn.FunCode != 'Cancel'), + :class="{'btn-primary':(btn.FunCode != 'Cancel'), 'btn-cancel':(btn.FunCode == 'Cancel'), 'btn-one':pageData.Button.length == 1, 'btn-left':(btnIndex < pageData.Button.length - 1), 'btn-right': btnIndex > 0 && btnIndex == pageData.Button.length - 1 , - 'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}" - :disabled="(btn.FunCode != 'Cancel' && pageData.okLoading)? true:false" - @click="onBtnClick(btn, pageData)"> - <Icon v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="Img" /> + 'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}" @click="onBtnClick(btn, pageData)"> + <text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="Img"></text> {{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}} </button> <view class="btn-right" v-if="pageData.DropDownButton.length >0 "> <a @click="clickDropdownBtns(pageData)"> - <Icon class="mobox-normal-more" /> + <text class="mobox-normal-more"></text> </a> </view> </view> @@ -113,7 +109,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import { dictGetInfo } from "@/api/mobox.js" @@ -123,15 +121,22 @@ } from "@/api/data.js" import dayjs from "dayjs"; import OIForm from '@/components/oi-form/index.vue' + import OIFormItem from '@/components/oi-form/list/index.vue' + import OIFormInput from '@/components/oi-form/list/input/index.vue' + import OIFormInputNumber from '@/components/oi-form/list/input-number/index.vue' + import buttonClickMixin from '@/mixins/button-click.js'; export default { name: "PageModal5601", - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm, + OIFormItem, + OIFormInput, + OIFormInputNumber + }, + data() { return { title: this.translateSys("inventory"), @@ -152,7 +157,6 @@ selectAttrObj: {}, global_attr: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} popupType: "center", check_list: {}, popupParam: {}, @@ -217,7 +221,7 @@ //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -239,10 +243,10 @@ }) } //鍔犺浇鍒濆鐣岄潰 - if (this.$data.param.Show_Welcom_Page) { - this.$data.param.Welcome_Page.Img = this.$data.param.Welcome_Page.Img.replace(/ /g, '+'); - this.$data.param.Welcome_Page.Width = parseInt(this.$data.param.Welcome_Page.Width); - this.$data.param.Welcome_Page.Height = parseInt(this.$data.param.Welcome_Page.Height); + if (this.param.Show_Welcom_Page) { + this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+'); + this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width); + this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height); }; //鍔犺浇Tab椤电 const pageList = this.param.Sub_Page || [] @@ -616,6 +620,7 @@ }, onClick(item) { + console.log("onClick", item) this.focusFieldId = item.fieldId }, ontap(item) { //鎵爜鍔熻兘 @@ -716,15 +721,19 @@ let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() - if (!newVal) + if (!newVal) { + item.oldvalue = newVal; + var attr = item.fieldId; + this.head_styledef.form.model[attr] = newVal; return + } + } if (item.oldvalue != newVal) { item.oldvalue = newVal; var attr = item.fieldId; this.head_styledef.form.model[attr] = newVal; var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�- if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� this.onChange(onChangeEvent); } @@ -754,7 +763,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -866,7 +875,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.head_styledef.form.clsId, + class_id: this.head_styledef.form.clsId, class_name: '', event_id: event.id, event_name: '', @@ -929,12 +938,12 @@ if (result.result_type == 0 && result.action) { result.action.forEach(item => { if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; $this.viewAceionRow(value); } else if (item.action_type == "set_subtable_page_content") { //宸茬爜鐩�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; const pageData = $this.pageDetail.find((page) => { return value.page_name == page.Name; @@ -972,6 +981,16 @@ pageData.DefList = []; $this.viewAceionContent(value); } + } else if (item.action_type == "select_subtable_page") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex((page) => { + return value.page_name == page.Name; + }); + if (pageIndex > -1) { + $this.setData({ + current: pageIndex + }) + } } else if (item.action_type == "select_subtable_page_row") { // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}} var value = item.value; @@ -1000,7 +1019,7 @@ const pageData = $this.pageDetail[pageIndex] pageData.DefList = [] pageData.ExtData = {} - + $this.$set(this.pageDetail, pageIndex, pageData) } @@ -1103,8 +1122,59 @@ return value.page_name == page.Name; }); if (pageData?.DefList) { - pageData.DefList.forEach(ele => { - if (ele.form.objId == value.row.id) { + const detailStyleDefList = pageData.DefList || [] + let bFindRow = false; + for (let index = 0; index < detailStyleDefList.length; index++) { + const ele = detailStyleDefList[index] + + if (value.row.id) { + if (ele.form.objId == value.row.id) { + bFindRow = true; + } + } else { + const conditions = row.condition || []; + if (conditions.length > 0) { + for (let index = 0; index < detailStyleDefList.length; index++) { + const ele = detailStyleDefList[index] + let bFindCondition = true; + for (let i in conditions) { + const condition = conditions[i]; + let bFind = false; + for (let i2 in ele.form.items) { + const ele2 = ele.form.items[i2]; + if (ele2.name != "Layout") { + if (ele2.fieldId == condition.attr) { + if (condition.value == ele2.value) { + bFind = true; + } + break; + } + } else { + const colList = ele2.setting.colList || []; + for (let i3 in colList) { + const col = colList[i3]; + if (col.fieldId == condition.attr) { + if (condition.value == col.value) { + bFind = true; + } + break; + } + } + if (bFind) break; + } + } + if (!bFind) { + bFindCondition = false; + break; + } + } + if (bFindCondition) { + bFindRow = true; + } + } + } + } + if (bFindRow) { ele.SelBut_Checked = true; this.active_id = ele.form.htmlobjId; //鑷姩婊氬姩鍒版寚瀹氬厓绱�@@ -1120,7 +1190,8 @@ }).exec(); }).exec(); } - }); + break + } } }, @@ -1129,23 +1200,73 @@ if (JSON.stringify(value.row) == '{}') { return; } - const pageIndex = $this.pageDetail.findIndex((page, index2, arr) => { + const pageIndex = this.pageDetail.findIndex((page, index2, arr) => { return value.page_name == page.Name; }) if (pageIndex < 0) return - const pageData = $this.pageDetail[pageIndex] + const pageData = this.pageDetail[pageIndex] if (pageData?.DefList) //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞//娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� { + const detailStyleDefList = pageData.DefList || [] value.row.forEach((row) => { - pageData.DefList.forEach((ele, index) => { - if (ele.form.objId == row.id) { - pageData.DefList.splice(index, 1); + if (row.id) { + for (let index = 0; index < detailStyleDefList.length; index++) { + const ele = detailStyleDefList[index] + if (ele.form.objId == row.id) { + detailStyleDefList.splice(index, 1); + index--; + } } - }); + + } else { + const conditions = row.condition || []; + if (conditions.length > 0) { + for (let index = 0; index < detailStyleDefList.length; index++) { + const ele = detailStyleDefList[index] + let bFindCondition = true; + for (let i in conditions) { + const condition = conditions[i]; + let bFind = false; + for (let i2 in ele.form.items) { + const ele2 = ele.form.items[i2]; + if (ele2.name != "Layout") { + if (ele2.fieldId == condition.attr) { + if (condition.value == ele2.value) { + bFind = true; + } + break; + } + } else { + const colList = ele2.setting.colList || []; + for (let i3 in colList) { + const col = colList[i3]; + if (col.fieldId == condition.attr) { + if (condition.value == col.value) { + bFind = true; + } + break; + } + } + if (bFind) break; + } + } + if (!bFind) { + bFindCondition = false; + break; + } + } + if (bFindCondition) { + detailStyleDefList.splice(index, 1); + + } + } + } + + } }); } - $this.$set(this.pageDetail, pageIndex, pageData) + this.$set(this.pageDetail, pageIndex, pageData) }, //鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭 viewActionSetRow(value) { @@ -1156,143 +1277,108 @@ if (pageIndex < 0) return const pageData = $this.pageDetail[pageIndex] - var detailStyleDefList = pageData.DefList || [] + const detailStyleDefList = pageData.DefList || [] detailStyleDefList.forEach(ele => { value.row.forEach((rowData) => { if (rowData.id) { if (ele.form.objId == rowData.id) { rowData.attrs.forEach(attr => { ele.form.items.forEach(ele2 => { - if (ele2.name != - 'Layout') { - if (ele2.fieldId == - attr - .attr) { - ele2.value = - $this - .operationNumber( - ele2 - .value, - attr - .value, - attr - .operation - ) + if (ele2.name != 'Layout') { + if (ele2.fieldId == attr.attr) { + ele2.value = $this.operationNumber( + ele2.value, + attr.value, + attr.operation + ) } - } else if (ele2.name == - 'Layout') { - ele2.setting - .colList - .forEach( - col => { - if ( - col) { - if (col - .fieldId == + } else if (ele2.name == 'Layout') { + ele2.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == attr + .attr) { + col.value = $this + .operationNumber( + col.value, + attr.value, attr - .attr - ) { - col.value = - $this - .operationNumber( - col - .value, - attr - .value, - attr - .operation - ) - } - } - }) + .operation + ) + } + } + }) } }); }); } } else if (rowData.condition) { - const conditions = rowData.condition; - let bFindCondition = true; - for (let i in conditions) { - const condition = conditions[i]; - let bFind = false; - for (let i2 in ele.form.items) { - const ele2 = ele.form.items[i2]; - if (ele2.name != "Layout") { - if (ele2.fieldId == condition.attr) { - if (condition.value == ele2.value) { - bFind = true; - } - break; - } - } else { - const colList = ele2.setting.colList || []; - for (let i3 in colList) { - const col = colList[i3]; - if (col.fieldId == condition.attr) { - if (condition.value == col.value) { + const conditions = rowData.condition || []; + if (conditions.length > 0) { + let bFindCondition = true; + for (let i in conditions) { + const condition = conditions[i]; + let bFind = false; + for (let i2 in ele.form.items) { + const ele2 = ele.form.items[i2]; + if (ele2.name != "Layout") { + if (ele2.fieldId == condition.attr) { + if (condition.value == ele2.value) { bFind = true; } break; } + } else { + const colList = ele2.setting.colList || []; + for (let i3 in colList) { + const col = colList[i3]; + if (col.fieldId == condition.attr) { + if (condition.value == col.value) { + bFind = true; + } + break; + } + } + if (bFind) break; } - if (bFind) break; + } + if (!bFind) { + bFindCondition = false; + break; } } - if (!bFind) { - bFindCondition = false; - break; - } - } - if (bFindCondition) { - - rowData.attrs.forEach(attr => { - ele.form.items.forEach(ele2 => { - if (ele2.name != - 'Layout') { - if (ele2.fieldId == - attr - .attr) { - ele2.value = - $this - .operationNumber( - ele2 - .value, - attr - .value, - attr - .operation - ) - } - } else if (ele2.name == - 'Layout') { - ele2.setting - .colList - .forEach( - col => { - if ( - col) { - if (col - .fieldId == - attr - .attr - ) { - col.value = - $this - .operationNumber( - col - .value, - attr - .value, - attr - .operation - ) - } + if (bFindCondition) { + rowData.attrs.forEach(attr => { + ele.form.items.forEach(ele2 => { + if (ele2.name != 'Layout') { + if (ele2.fieldId == attr.attr) { + ele2.value = + $this.operationNumber( + ele2.value, + attr.value, + attr.operation + ) + } + } else if (ele2.name == 'Layout') { + ele2.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == attr + .attr) { + col.value = + $this + .operationNumber( + col.value, + attr + .value, + attr + .operation) } - }) - } + } + }) + } + }); }); - }); + } } } }) @@ -1321,28 +1407,22 @@ data.row.forEach(row => { detailStyle = JSON.parse(styleStr); detailStyle.form.objId = row.id; - detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '') + detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '').replace('{', '') .replace( - '{', '').replace('}', - '') : 'null'; + '}', '') : 'null'; detailStyle.form.attrs = row.attrs; row.attrs.forEach(attr => { detailStyle.form.items.forEach(ele => { if (ele.name != 'Layout') { - if (ele.fieldId == attr.attr) ele - .value = - attr.value; + if (ele.fieldId == attr.attr) + ele.value = attr.value; } else if (ele.name == 'Layout') { - ele.setting.colList.forEach( - col => { - if (col) { - if (col.fieldId == - attr - .attr) col - .value = attr - .value; - } - }); + ele.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == attr.attr) + col.value = attr.value; + } + }); } }); }); @@ -1385,18 +1465,15 @@ cont.attrs.forEach(attr => { detailStyle.form.items.forEach(ele => { if (ele.name != 'Layout') { - if (ele.fieldId == attr.attr) ele - .value = - attr.value; + if (ele.fieldId == attr.attr) + ele.value = attr.value; } else if (ele.name == 'Layout') { ele.setting.colList.forEach( col => { if (col) { if (col.fieldId == - attr - .attr) col - .value = attr - .value; + attr.attr) + col.value = attr.value; } }); } @@ -1406,42 +1483,25 @@ if (data.clear == false) { var isflag = true; pageData.DefList.forEach((style, index) => { - if (style.form.objId == detailStyle.form - .objId) { + if (style.form.objId == detailStyle.form.objId) { cont.attrs.forEach(attr => { - style.form.items.forEach( - ele => { - if (ele.name != - 'Layout') { - if (ele - .fieldId == - attr.attr) - ele - .value = - attr.value; - } else if (ele - .name == - 'Layout') { - ele.setting - .colList - .forEach( - col => { - if ( - col - ) { - if (col - .fieldId == - attr - .attr - ) - col - .value = - attr - .value; - } - }); - } - }); + style.form.items.forEach(ele => { + if (ele.name != 'Layout') { + if (ele.fieldId == attr.attr) + ele.value = attr.value; + } else if (ele.name == 'Layout') { + ele.setting.colList.forEach( + col => { + if (col) { + if (col.fieldId == + attr + .attr) + col.value = + attr.value; + } + }); + } + }); }); isflag = false; } @@ -1535,7 +1595,7 @@ async del(pageData, style, event) { //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(col => { if (col != null) head_attr[col.fieldId] = @@ -1628,15 +1688,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -1644,7 +1704,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -1658,7 +1718,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, @@ -1676,7 +1736,7 @@ }); return; } - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -1684,12 +1744,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.ClsID, + clsid: $this.ClsID, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, @@ -1697,18 +1757,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.ClsID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.ClsID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.ClsID, //褰撳墠鏁版嵁绫籭d + class_id: this.ClsID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1724,7 +1784,7 @@ } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var input_param = Base64.encode(JSON.stringify(info.attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -1801,44 +1861,41 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; result.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items - .forEach( - async (ele, - index) => { - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (ele.name != 'Layout') { - if (ele.fieldId == attr - .attr) { - ele.show = attr - .show; + $this.head_styledef.form.items.forEach(async ( + ele, + index) => { + //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+ if (ele.name != 'Layout') { + if (ele.fieldId == attr + .attr) { + ele.show = attr.show; + } + } else if (ele.name == + 'Layout') { + ele.setting.colList + .forEach((col) => { + if (col) { + if (col + .fieldId == + attr + .attr + ) { + col.show = + attr + .show; + } } - } else if (ele.name == - 'Layout') { - ele.setting.colList - .forEach( - col => { - if (col) { - if (col - .fieldId == - attr - .attr - ) { - col.show = - attr - .show; - } - } - }); - } - }); + }); + } + }); }); var head_styledef = JSON.parse(JSON.stringify($this.$data .head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; - // console.log($this.$data.head_styledef); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } else { uni.showModal({ title: this.translateSys("tip"), @@ -1858,62 +1915,7 @@ console.log($this.head_styledef); if (data.result) { var result = data.result; - for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items - .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = - result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = - result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = - result[i].value; - } - } - }); - } - } - - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] - .attr) { - $this.$data.refdatastore[j].value = result[i] - .value; - } - } - } - } + $this.setFormValues(result) } } @@ -1950,18 +1952,6 @@ attr: a, value: obj_attr[a] || "", })); - if ($this.refdatastore.length > 0) { - for (var i = 0; i < $this.refdatastore.length; i++) { - if (!req.filter(function(s) { - return $this.refdatastore[i].attr == s.name - }).length) { - req.push({ - 'attr': $this.refdatastore[i].attr, - 'value': $this.refdatastore[i].value - }); - } - } - } var extinfo = enviroment; extinfo.edit_dlg = { @@ -2092,7 +2082,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .DataCls .id, objid: "", @@ -2181,8 +2171,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -2294,7 +2284,13 @@ }) } else { - this.onButtonClicked(btn, pageData, -1); + this.handleButtonClick((done) => { + this.onButtonClicked(btn, pageData, -1); + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + } }, onRowBtnClick(btn, pageData, index) { @@ -2315,7 +2311,13 @@ }) } else { - this.onButtonClicked(btn, pageData, index); + this.handleButtonClick((done) => { + this.onButtonClicked(btn, pageData, index); + setTimeout(() => { + done(); // 閲嶇疆鐘舵� + }, 1000); + }); + } }, onButtonClicked(btn, pageData, index) { @@ -2410,7 +2412,8 @@ } else { ele.setting.colList.forEach(async (col) => { if (col) { - let value = formData[col.fieldId] + let value = formData[col + .fieldId] if (value) col.value = value } @@ -2418,7 +2421,6 @@ } }) $this.$set($this.pageDetail, pageIndex, pageData) - }, } @@ -2461,7 +2463,8 @@ } else { ele.setting.colList.forEach(async (col) => { if (col) { - let value = formData[col.fieldId] + let value = formData[col + .fieldId] if (value) col.value = value } @@ -2469,6 +2472,7 @@ } }) $this.$set($this.pageDetail, pageIndex, pageData) + console.log($this.pageDetail) }, } @@ -2480,10 +2484,10 @@ this.After_OK_Event = pageData.After_ok; // console.log(this.Before_OK_Event); // console.log(this.After_OK_Event); - if (this.$data.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 - this.sava(pageData, this.$data.Before_OK_Event); - else if (this.$data.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 - this.sava(pageData, this.$data.After_OK_Event); + if (this.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 + this.sava(pageData, this.Before_OK_Event); + else if (this.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 + this.sava(pageData, this.After_OK_Event); }, sava(pageData, event) { var $this = this; @@ -2504,9 +2508,8 @@ return false; } //鑾峰彇琛ㄥご灞炴� - pageData.okLoading = true var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(col => { if (col != null) head_attr[col.fieldId] = @@ -2584,7 +2587,6 @@ }); }); if (jsonlist.length == 0) { - pageData.okLoading = false uni.showModal({ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), @@ -2614,7 +2616,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.ClsID, + class_id: this.ClsID, class_name: '', event_id: event.ID, event_name: '', @@ -2630,8 +2632,6 @@ global_attr: '', input_param: input_param, }; - - // console.log(dataInfo); runCustomEvent(dataInfo).then(result => { console.log(result); if (result.ret != 0) { @@ -2678,57 +2678,82 @@ // uni.showModal({title:this.translateSys("tip"),content:JSON.stringify(result.action),showCancel:false,confirmText:this.translateSys("cancel")}); result.action.forEach(item => { - if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�+ if (item.action_type == + "insert_subtable_page_row") { //鐮佺洏涓� var value = item.value; //鍔犺浇宸茬粡鐮佺洏鏁版嵁 $this.viewAceionRow(value); //娓呯┖鏉$爜鍐呭 - $this.$data.head_styledef.form.items.forEach((item, index) => { - if (item.fieldId != "S_CNTR_CODE") { + $this.head_styledef.form.items.forEach((item, + index) => { + if (item.fieldId != + "S_CNTR_CODE") { item.value = ''; item.oldvalue = ''; - $this.$data.head_styledef.form.model[item + $this.head_styledef.form.model[ + item .fieldId] = ''; } }); uni.showModal({ title: $this.translateSys("tip"), - content: $this.translate('execute_event_success'), + content: $this.translate( + 'execute_event_success'), showCancel: false, - confirmText: $this.translateSys('close') + confirmText: $this.translateSys( + 'close') }); } else if (item.action_type == "set_subtable_page_content" ) { //宸茬爜鐩�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; + const pageData = $this.pageDetail.find(( + page) => { + return value.page_name == page + .Name; }); - if (value.clear_confirm != false && value.clear == true && + if (value.clear_confirm != false && value + .clear == true && pageData && pageData.DefList.length > 0 ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹� uni.showModal({ - title: $this.translateSys('tip'), + title: $this.translateSys( + 'tip'), content: $this.translate( - "are_you_sure_clear_first") + - $this.translateSys("quotation_mark_left") + + "are_you_sure_clear_first" + ) + + $this.translateSys( + "quotation_mark_left" + ) + value.page_name + $this.translateSys( - "quotation_mark_right") + - $this.translate("are_you_sure_clear_last"), - cancelText: $this.translateSys('ok'), - confirmText: $this.translateSys('cancel'), + "quotation_mark_right" + ) + + $this.translate( + "are_you_sure_clear_last" + ), + cancelText: $this.translateSys( + 'ok'), + confirmText: $this + .translateSys('cancel'), success: function(res) { if (res.cancel) { if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); - } else if (res.confirm) { + pageData + .DefList = []; + $this + .viewAceionContent( + value); + } else if (res + .confirm) { if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); + pageData + .DefList = []; + $this + .viewAceionContent( + value); } } }); @@ -2738,45 +2763,70 @@ $this.viewAceionContent(value); } } else if (item.action_type == + "select_subtable_page") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex(( + page) => { + return value.page_name == page + .Name; + }); + if (pageIndex > -1) { + $this.setData({ + current: pageIndex + }) + } + } else if (item.action_type == "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� let value = item.value; $this.viewActionRemoveRow(value) - } else if (item.action_type == "set_subtable_page_row") { + } else if (item.action_type == + "set_subtable_page_row") { $this.viewActionSetRow(item.value) - } else if (item.action_type == "set_subtable_page_ext_data") { + } else if (item.action_type == + "set_subtable_page_ext_data") { let value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; + const pageData = $this.pageDetail.find(( + page) => { + return value.page_name == page + .Name; }); if (pageData) { pageData.ExtData = value.ext_data } - } else if (item.action_type == "clear_subpage_rows") { + } else if (item.action_type == + "clear_subpage_rows") { var value = item.value; - const pageIndex = $this.pageDetail.findIndex((page) => { - return value.page_name == page.Name; + const pageIndex = $this.pageDetail.findIndex(( + page) => { + return value.page_name == page + .Name; }); if (pageIndex > -1) { - const pageData = $this.pageDetail[pageIndex] + const pageData = $this.pageDetail[ + pageIndex] pageData.DefList = [] pageData.ExtData = {} - $this.$set(this.pageDetail, pageIndex, pageData) + $this.$set(this.pageDetail, pageIndex, + pageData) } - } else if (item.action_type == "set_dlg_current_edit_attr") { + } else if (item.action_type == + "set_dlg_current_edit_attr") { if ($this.focusOldFieldId == item.value) $this.setData({ focusFieldId: "" }) else { $this.setData({ - focusFieldId: $this.focusOldFieldId + focusFieldId: $this + .focusOldFieldId }) } $this.$nextTick(() => { $this.setData({ - focusFieldId: item.value + focusFieldId: item + .value }) }); } else if (item.action_type == @@ -2788,8 +2838,8 @@ }); } else { - if ($this.$data.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 - $this.sava(pageParam, $this.$data.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ if ($this.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 + $this.sava(pageParam, $this.After_OK_Event); //鎵ц纭畾鍚庝簨浠� } } @@ -2806,9 +2856,8 @@ } } - pageParam.okLoading = false }).catch(ex => { - pageParam.okLoading = false + console.log(ex); let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex uni.showModal({ title: this.translateSys("error") + "8.1", diff --git a/pages/modal/5602.vue b/pages/modal/5602.vue index bb6d4d2..d045b65 100644 --- a/pages/modal/5602.vue +++ b/pages/modal/5602.vue @@ -197,7 +197,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import { appGetInfo, dictGetInfo @@ -210,9 +212,6 @@ } from "@/api/data.js" export default { - modules: { - Base64, - }, data() { return { title: this.translateSys("sorting"), @@ -246,7 +245,6 @@ global_attr: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} popupType: "center", check_list: {}, popupParam: {}, @@ -257,9 +255,9 @@ uni.setNavigationBarTitle({ title: options.titlename }); //璁剧疆椤堕儴鏍囬 - this.$data.title = options.titlename; - this.$data.param = JSON.parse(options.param); - // console.log(this.$data.param); + this.title = options.titlename; + this.param = JSON.parse(options.param); + // console.log(this.param); this.loadData(options.paramValue) }, methods: { @@ -287,11 +285,11 @@ async loadData(paramValue) { //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- await this.Head_UIStyleGetInfo(this.$data.ClsID, this.$data.param.Input_UI_Style.ID); + await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID); //浼犲叆鍙傛暟鍊� if (paramValue) { const attrs = paramValue.attrs || []; - (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => { + (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { if (ele.name != "Layout") { attrs.forEach(async (ele2, index2) => { if (ele.fieldId == ele2.name) { @@ -314,19 +312,19 @@ } //鍔犺浇鍒濆鐣岄潰 - if (this.$data.param.Show_Welcom_Page) { - this.$data.param.Welcome_Page.Img = this.$data.param.Welcome_Page.Img.replace(/ /g, '+'); - this.$data.param.Welcome_Page.Width = parseInt(this.$data.param.Welcome_Page.Width); - this.$data.param.Welcome_Page.Height = parseInt(this.$data.param.Welcome_Page.Height); + if (this.param.Show_Welcom_Page) { + this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+'); + this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width); + this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height); } //鍔犺浇Tab椤电 - this.$data.items.push(this.$data.param.Sub_Page[0].Name); - this.$data.items.push(this.$data.param.Sub_Page[1].Name); - await this.Detail1_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[0].UI_Style.ID); - await this.Detail2_UIstyleGetInfo(this.ClsID2, this.$data.param.Sub_Page[1].UI_Style.ID); + this.items.push(this.param.Sub_Page[0].Name); + this.items.push(this.param.Sub_Page[1].Name); + await this.Detail1_UIstyleGetInfo(this.ClsID, this.param.Sub_Page[0].UI_Style.ID); + await this.Detail2_UIstyleGetInfo(this.ClsID2, this.param.Sub_Page[1].UI_Style.ID); - console.log(this.$data.param); + console.log(this.param); }, changeSwiper(evt) { let index = evt.target.current || evt.detail.current; @@ -375,7 +373,7 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.head_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.head_styledef = result.style_def ? JSON.parse(styledef) : {}; if ($this.head_styledef.form?.items) { $this.head_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 @@ -436,13 +434,13 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail1_styledef.SelBut_Checked = true; - // console.log($this.$data.detail1_styledef); - // $this.$data.detail1StyleDefList.push($this.$data.detail1_styledef); + $this.detail1_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail1_styledef.SelBut_Checked = true; + // console.log($this.detail1_styledef); + // $this.detail1StyleDefList.push($this.detail1_styledef); // var aa = JSON.stringify(this.detail1_styledef); - // $this.$data.detail1StyleDefList.push(JSON.parse(aa)); - // console.log($this.$data.detail1StyleDefList); + // $this.detail1StyleDefList.push(JSON.parse(aa)); + // console.log($this.detail1StyleDefList); if ($this.detail1_styledef.form?.items) { $this.detail1_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 @@ -496,8 +494,8 @@ if (!result.style_def.includes('"')) styledef = Base64.decode(result .style_def); } - $this.$data.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; - $this.$data.detail2_styledef.SelBut_Checked = true; + $this.detail2_styledef = result.style_def ? JSON.parse(styledef) : {}; + $this.detail2_styledef.SelBut_Checked = true; } catch (ex) { // console.log(ex); let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex @@ -554,7 +552,7 @@ var detail1_styledef = JSON.parse(JSON.stringify($this.detail1_styledef)); $this.detail1_styledef = []; $this.detail1_styledef = detail1_styledef; - // console.log($this.$data.detail1_styledef); + // console.log($this.detail1_styledef); } } catch (ex) { @@ -697,7 +695,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -802,7 +800,7 @@ var dataInfo = { ed_type: 0, start_transaction: '', - class_id: this.$data.head_styledef.form.clsId, + class_id: this.head_styledef.form.clsId, class_name: '', event_id: event.id, event_name: '', @@ -855,16 +853,16 @@ if (result.result_type == 0 && result.action) { result.action.forEach(item => { if (item.action_type == "insert_subtable_page_row") { //鍒嗘嫞涓�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; $this.viewAceionRow(value); } else if (item.action_type == "set_subtable_page_content") { //宸插垎鎷�- $this.$data.param.Show_Welcom_Page = false; + $this.param.Show_Welcom_Page = false; var value = item.value; if (value.clear_confirm != false && value.clear == - true && $this.$data.detail1StyleDefList.length > - 0 && value.page_name == $this.$data.param.Sub_Page[ + true && $this.detail1StyleDefList.length > + 0 && value.page_name == $this.param.Sub_Page[ 0].Name) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鍒嗘嫞鏄惁鏈夋暟鎹� uni.showModal({ title: this.translateSys("tip"), @@ -893,11 +891,11 @@ } }); } else { - if (value.page_name == $this.$data.param.Sub_Page[ + if (value.page_name == $this.param.Sub_Page[ 0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - $this.$data.detail1StyleDefList = []; + $this.detail1StyleDefList = []; } else { - $this.$data.detail2StyleDefList = []; + $this.detail2StyleDefList = []; } $this.viewAceionContent(value); } @@ -940,7 +938,7 @@ .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� value.row.forEach(row => { - $this.$data.detail1StyleDefList + $this.detail1StyleDefList .forEach((ele, index) => { if (ele.form.objId == row .id) { @@ -957,12 +955,12 @@ } else if (item.action_type == "set_subtable_page_ext_data") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1ExtData: value.ext_data }) - } else if (value.page_name == $this.$data.param + } else if (value.page_name == $this.param .Sub_Page[1].Name) { $this.setData({ detail2ExtData: value.ext_data @@ -970,13 +968,13 @@ } } else if (item.action_type == "clear_subpage_rows") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1StyleDefList: [], detail1ExtData: {} }) - } else if (value.page_name == $this.$data.param + } else if (value.page_name == $this.param .Sub_Page[1].Name) { $this.setData({ detail2StyleDefList: [], @@ -1002,42 +1000,7 @@ } else if (item.action_type == "set_dlg_attr") { // value = {"attr":"xxx", "value":"xxx"} var data = item.value; - $this.$data.head_styledef.form.items.forEach(async ( - ele, index) => { - data.forEach(async (ele2, index) => { - if (ele.fieldId == ele2 - .attr) { - if (ele.name == - 'Select' && - ele2 - .choice_list) { - const - dictItemList = []; - const - choiceList = - ele2 - .choice_list || - []; - for (let d in - choiceList) { - const val = - choiceList[ - d]; - dictItemList - .push({ - text: val, - value: val - }); - } - ele.dict = - dictItemList; - } - ele.value = ele2 - .value; - - } - }); - }); + $this.setFormValues(data) } }); } else { @@ -1107,14 +1070,81 @@ return 0; } }, - //鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭 + setFormValues(attrs) { + const head_styledef = this.head_styledef + if (JSON.stringify(attrs) == '{}') { + return; + } + console.log(attrs) + attrs.forEach(async (attr, key) => { + if (attr.choice_list) { + var dictItemList = []; + attr.choice_list.forEach(async (val, index) => { + dictItemList.push({ + text: val, + value: val + }); + }); + + head_styledef.form.items.forEach(async (attr_item, index) => { + if (attr_item.name != "Layout") { + if (attr_item.fieldId == attr.attr) { + if (attr_item.useDict) { + attr_item.dict = dictItemList; + } else { + attr_item.selections = dictItemList; + } + } + } else if (attr_item.name == "Layout") { + attr_item.setting.colList.forEach((col) => { + if (col) { + if (col.fieldId == attr.attr) { + if (col.useDict) { + col.dict = dictItemList; + } else { + col.selections = dictItemList; + } + } + } + }); + } + }); + } + if (!head_styledef.form.model[attr.attr]) { + head_styledef.form.model[attr.attr] = attr.value; + } + head_styledef.form.items.forEach(async (ele) => { + if (ele.name != "Layout") { + if (ele.fieldId == attr.attr) { + ele.value = attr.value; + ele.oldvalue = attr.value; + } + } else if (ele.name == "Layout") { + ele.setting.colList.forEach((col) => { + if (col) { + if (col.fieldId == attr.attr) { + col.value = attr.value; + col.oldvalue = attr.value; + } + } + }); + } + + }) + //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+ }) + console.log(head_styledef) + this.setData({ + head_styledef: head_styledef + }) + }, //鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭 viewActionSetRow(value) { const $this = this var detailStyleDefList = [] - if (value.page_name == $this.$data.param.Sub_Page[1].Name) { - detailStyleDefList = $this.$data.detail2StyleDefList - } else if (value.page_name == $this.$data.param.Sub_Page[0].Name) { - detailStyleDefList = $this.$data.detail1StyleDefList + if (value.page_name == $this.param.Sub_Page[1].Name) { + detailStyleDefList = $this.detail2StyleDefList + } else if (value.page_name == $this.param.Sub_Page[0].Name) { + detailStyleDefList = $this.detail1StyleDefList } detailStyleDefList.forEach(ele => { value.row.forEach((rowData) => { @@ -1207,11 +1237,11 @@ } }) }); - if (value.page_name == $this.$data.param.Sub_Page[1].Name) { + if (value.page_name == $this.param.Sub_Page[1].Name) { $this.setData({ detail2StyleDefList: detailStyleDefList }) - } else if (value.page_name == $this.$data.param.Sub_Page[0].Name) { + } else if (value.page_name == $this.param.Sub_Page[0].Name) { $this.setData({ detail1StyleDefList: detailStyleDefList }) @@ -1225,12 +1255,12 @@ if (JSON.stringify(data.row) == '{}') { return; } - var styleStr = JSON.stringify(this.$data.detail1_styledef); + var styleStr = JSON.stringify(this.detail1_styledef); if (type) { //纭畾鍚庤剼鏈繘鍏ュ姞杞藉凡鍒嗘嫞鏁版嵁 - styleStr = JSON.stringify(this.$data.detail2_styledef); + styleStr = JSON.stringify(this.detail2_styledef); } else { - if (data.page_name == this.$data.param.Sub_Page[1].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 - styleStr = JSON.stringify(this.$data.detail2_styledef); //寰呭垎鎷�+ if (data.page_name == this.param.Sub_Page[1].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 + styleStr = JSON.stringify(this.detail2_styledef); //寰呭垎鎷� } } data.row.forEach(row => { @@ -1258,19 +1288,19 @@ }); if (type) { //纭畾鍚庤剼鏈繘鍏ュ姞杞藉凡鍒嗘嫞鏁版嵁 - this.$data.detail2StyleDefList.push(detailStyle); - // console.log(this.$data.detail2StyleDefList); + this.detail2StyleDefList.push(detailStyle); + // console.log(this.detail2StyleDefList); } else { - if (data.page_name == this.$data.param.Sub_Page[1] + if (data.page_name == this.param.Sub_Page[1] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄凡鍒嗘嫞 - this.$data.detail2StyleDefList.push(detailStyle); - // console.log(this.$data.detail2StyleDefList); + this.detail2StyleDefList.push(detailStyle); + // console.log(this.detail2StyleDefList); } else { - this.$data.detail1StyleDefList.push(detailStyle); + this.detail1StyleDefList.push(detailStyle); this.activelist.push({ active: false }); - // console.log(this.$data.detail1StyleDefList); + // console.log(this.detail1StyleDefList); } } } @@ -1288,9 +1318,9 @@ if (JSON.stringify(data.content) == '{}') { return; } - var styleStr = JSON.stringify($this.$data.detail2_styledef); //宸插垎鎷�- if (data.page_name == $this.$data.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - styleStr = JSON.stringify($this.$data.detail1_styledef); //寰呭垎鎷�+ var styleStr = JSON.stringify($this.detail2_styledef); //宸插垎鎷�+ if (data.page_name == $this.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 + styleStr = JSON.stringify($this.detail1_styledef); //寰呭垎鎷� } data.content.forEach(cont => { @@ -1317,7 +1347,7 @@ }); }); - if (data.page_name == $this.$data.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 + if (data.page_name == $this.param.Sub_Page[0].Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //濡傛灉 clear = false 鍒欎笉闇�娓呴櫎锛屾牴鎹甶d鍒ゆ柇鏄惁瀛樺湪锛屼笉瀛樺湪鎻掑叆鍒伴〉闈紝濡傛灉瀛樺湪鐢ㄦ柊鐨勫睘鎬ц鐩� if (data.clear == false) { var isflag = true; @@ -1351,7 +1381,7 @@ $this.activelist.push({ active: false }); - // console.log($this.$data.detail1StyleDefList); + // console.log($this.detail1StyleDefList); } else { if (data.clear == false) { //濡傛灉 clear = false 鍒欎笉闇�娓呴櫎锛屾牴鎹甶d鍒ゆ柇鏄惁瀛樺湪锛屼笉瀛樺湪鎻掑叆鍒伴〉闈紝濡傛灉瀛樺湪鐢ㄦ柊鐨勫睘鎬ц鐩�@@ -1383,7 +1413,7 @@ } else { $this.detail2StyleDefList.push(detailStyle); //宸插垎鎷� } - // console.log($this.$data.detail2StyleDefList); + // console.log($this.detail2StyleDefList); } } }); @@ -1465,7 +1495,7 @@ async del(style, event) { //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); @@ -1546,7 +1576,7 @@ async del2(style, event) { //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); @@ -1632,7 +1662,7 @@ ele.active = false; }); this.activelist[value].active = true; - // console.log(this.$data.activelist); + // console.log(this.activelist); }, popupChange(e) { console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show); @@ -1641,15 +1671,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -1657,7 +1687,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -1671,7 +1701,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, @@ -1689,7 +1719,7 @@ }); return; } - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -1697,12 +1727,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.ClsID, + clsid: $this.ClsID, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, @@ -1710,18 +1740,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: this.translateSys('add2'), master: { - cls_id: this.$data.ClsID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.ClsID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.ClsID, //褰撳墠鏁版嵁绫籭d + class_id: this.ClsID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1737,7 +1767,7 @@ } enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var input_param = Base64.encode(JSON.stringify(info.attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 if (info.dataJson) info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 var obj_attr = {}; @@ -1814,7 +1844,7 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; result.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items + $this.head_styledef.form.items .forEach( async (ele, index) => { @@ -1847,11 +1877,11 @@ }); var head_styledef = JSON.parse(JSON.stringify($this.$data .head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; - // console.log($this.$data.head_styledef); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } else { uni.showModal({ title: this.translateSys("tip"), @@ -1870,63 +1900,7 @@ } console.log($this.head_styledef); if (data.result) { - var result = data.result; - for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items - .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = - result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = - result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = - result[i].value; - } - } - }); - } - } - - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] - .attr) { - $this.$data.refdatastore[j].value = result[i] - .value; - } - } - } - } + $this.setFormValues(data.result) } } @@ -1962,19 +1936,6 @@ attr: a, value: obj_attr[a] || "", })); - if ($this.refdatastore.length > 0) { - for (var i = 0; i < $this.refdatastore.length; i++) { - if (!req.filter(function(s) { - return $this.refdatastore[i].attr == s.name - }).length) { - req.push({ - 'attr': $this.refdatastore[i].attr, - 'value': $this.refdatastore[i].value - }); - } - } - } - var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�@@ -2104,7 +2065,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param + clsid: $this.param .DataCls .id, objid: "", @@ -2192,8 +2153,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -2269,15 +2230,15 @@ this.After_OK_Event = this.param.Sub_Page[0].After_ok; // console.log(this.Before_OK_Event); // console.log(this.After_OK_Event); - if (this.$data.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 - this.sava(this.$data.Before_OK_Event); - else if (this.$data.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 - this.sava(this.$data.After_OK_Event); + if (this.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 + this.sava(this.Before_OK_Event); + else if (this.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 + this.sava(this.After_OK_Event); }, sava(event) { var $this = this; - if (this.$data.detail1StyleDefList.length == 0) { + if (this.detail1StyleDefList.length == 0) { uni.showModal({ title: this.translateSys("tip"), content: this.translate( @@ -2295,13 +2256,13 @@ this.okLoading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); //鑾峰彇姝e湪鍒嗘嫞灞炴� var detailAttrList = []; - this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { var detail_attr = {}; style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -2321,7 +2282,7 @@ }); // console.log(detailAttrList); //鑾峰彇姝e湪鍒嗘嫞閲屾病鏈夋樉绀虹殑瀛楁 - this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { if (style.form.objId == detailAttrList[key]['id']) { @@ -2387,15 +2348,15 @@ this.After_OK_Event = this.param.Sub_Page[1].After_ok; // console.log(this.Before_OK_Event); // console.log(this.After_OK_Event); - if (this.$data.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 - this.sava2(this.$data.Before_OK_Event); - else if (this.$data.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 - this.sava2(this.$data.After_OK_Event); + if (this.Before_OK_Event.ID) //鏄惁鏈夌‘瀹氬墠浜嬩欢 + this.sava2(this.Before_OK_Event); + else if (this.After_OK_Event.ID) //鏄惁鏈夌‘瀹氬悗浜嬩欢 + this.sava2(this.After_OK_Event); }, sava2(event) { var $this = this; - if (this.$data.detail1StyleDefList.length == 0) { + if (this.detail1StyleDefList.length == 0) { uni.showModal({ title: this.translateSys("tip"), content: this.translate( @@ -2413,13 +2374,13 @@ this.ok2Loading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; - this.$data.head_styledef.form.items.forEach(item => { + this.head_styledef.form.items.forEach(item => { head_attr[item.fieldId] = item.value; }); // console.log(head_attr); //鑾峰彇宸插垎鎷e睘鎬� var detailAttrList = []; - this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { var detail_attr = {}; style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -2439,7 +2400,7 @@ }); // console.log(detailAttrList); //鑾峰彇宸插垎鎷i噷娌℃湁鏄剧ず鐨勫瓧娈�- this.$data.detail1StyleDefList.forEach(style => { + this.detail1StyleDefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { if (style.form.objId == detailAttrList[key]['id']) { @@ -2510,7 +2471,7 @@ var dataInfo = { ed_type: 0, start_transaction: true, - class_id: this.$data.ClsID, + class_id: this.ClsID, class_name: '', event_id: event.ID, event_name: '', @@ -2569,19 +2530,19 @@ $this.viewAceionRow(value, ''); // $this.viewAceionRow(value,'add'); //娓呯┖鏉$爜鍐呭 - $this.$data.head_styledef.form.items.forEach((item, + $this.head_styledef.form.items.forEach((item, index) => { if (item.fieldId != "S_CNTR_CODE") { item.value = ''; item.oldvalue = ''; - $this.$data.head_styledef.form.model[item + $this.head_styledef.form.model[item .fieldId] = ''; } }); //娓呴櫎寰呭垎鎷d腑鎴愬姛鐨勬暟鎹�- // $this.$data.detail1StyleDefList.forEach((style,index)=>{ + // $this.detail1StyleDefList.forEach((style,index)=>{ // if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){ - // $this.$data.detail1StyleDefList.splice(index,1); + // $this.detail1StyleDefList.splice(index,1); // return; // } // }); @@ -2632,7 +2593,7 @@ .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� value.row.forEach(row => { - $this.$data.detail1StyleDefList.forEach(( + $this.detail1StyleDefList.forEach(( ele, index) => { if (ele.form.objId == row.id) { $this.$data @@ -2647,12 +2608,12 @@ } else if (item.action_type == "set_subtable_page_ext_data") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1ExtData: value.ext_data }) - } else if (value.page_name == $this.$data.param.Sub_Page[1] + } else if (value.page_name == $this.param.Sub_Page[1] .Name) { $this.setData({ detail2ExtData: value.ext_data @@ -2660,13 +2621,13 @@ } } else if (item.action_type == "clear_subpage_rows") { var value = item.value; - if (value.page_name == $this.$data.param.Sub_Page[0] + if (value.page_name == $this.param.Sub_Page[0] .Name) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 $this.setData({ detail1StyleDefList: [], detail1ExtData: {} }) - } else if (value.page_name == $this.$data.param.Sub_Page[1] + } else if (value.page_name == $this.param.Sub_Page[1] .Name) { $this.setData({ detail2StyleDefList: [], @@ -2691,41 +2652,7 @@ } else if (item.action_type == "set_dlg_attr") { // value = {"attr":"xxx", "value":"xxx"} var data = item.value; - $this.$data.head_styledef.form.items.forEach(async ( - ele, index) => { - data.forEach(async (ele2, index) => { - if (ele.fieldId == ele2 - .attr) { - if (ele.name == - 'Select' && - ele2 - .choice_list) { - const - dictItemList = []; - const - choiceList = - ele2 - .choice_list || []; - for (let d in - choiceList) { - const val = - choiceList[ - d]; - dictItemList - .push({ - text: val, - value: val - }); - } - ele.dict = - dictItemList; - } - ele.value = ele2 - .value; - - } - }); - }); + $this.setFormValues(data) } else if (item.action_type == "refresh") { //鍒锋柊 var value = item.value; //娓呴櫎寰呭垎鎷f垚鍔熺殑鏁版嵁 @@ -2740,8 +2667,8 @@ //鍒锋柊褰撳墠椤甸潰 uni.redirectTo({ url: '../modal/5602?param=' + JSON.stringify( - this.$data.param) + "&titlename=" + - this.$data.title + this.param) + "&titlename=" + + this.title }); } else if (item.action_type == "prompt") { //鎵撳紑绯荤粺鎻愮ず寮规 var value = ''; @@ -2758,16 +2685,16 @@ } }); } else { - if ($this.$data.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 + if ($this.After_OK_Event.ID != event.ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 if (type == '1') { - $this.sava($this.$data.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ $this.sava($this.After_OK_Event); //鎵ц纭畾鍚庝簨浠� } else { - $this.sava2($this.$data.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ $this.sava2($this.After_OK_Event); //鎵ц纭畾鍚庝簨浠� } } } } else { - // $this.$data.detail2StyleDefList=[]; + // $this.detail2StyleDefList=[]; if (result.info) { uni.showModal({ title: this.translateSys("tip"), diff --git a/pages/modal/classAttr.vue b/pages/modal/classAttr.vue index d2042d1..ecd1e62 100644 --- a/pages/modal/classAttr.vue +++ b/pages/modal/classAttr.vue @@ -357,7 +357,7 @@ title: options.titlename }); //璁剧疆椤堕儴鏍囬 var param = JSON.parse(options.param); - this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 + this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 // console.log(param); if (!param.EditDlgMode) { uni.showModal({ @@ -377,7 +377,7 @@ }); return; } - this.$data.param = param; + this.param = param; this.loadData() }, @@ -413,7 +413,7 @@ var dataInfo = { class_id: this.param.clsid }; - this.$data.classAttrList = await classAttrList(dataInfo) || [] + this.classAttrList = await classAttrList(dataInfo) || [] var gridstyleInfo = { class_id: this.param.clsid, @@ -423,8 +423,8 @@ const res = await classGridStyleInfo(gridstyleInfo) res.StyleDef = JSON.parse(res.StyleDef); - this.$data.classGridStyle = res; - // console.log($this.$data.classGridStyle); + this.classGridStyle = res; + // console.log($this.classGridStyle); this.class_attr_init(); } catch (ex) { @@ -438,16 +438,16 @@ }, classAttr_extButton(index, iindex) { //寮规灞傛樉绀�type:top bottom center left right var $this = this; - $this.$data.popupType = 'right' + $this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� $this.$refs.popup.open($this.popupType); - var data_attr = $this.$data.classAttrList[index].Attr[iindex]; + var data_attr = $this.classAttrList[index].Attr[iindex]; // var value = action.value; // var action ={"action_type":"open_common_dlg","value":{"common_dlg_id":"check_list","config":{"title":"鐢熶骇宸ュ崟","appear_style":"sideslip","width":250,"multiple_choice":"1","items":[{"id":"133D50D7-D798-4D2E-A15F-308365092DF5","name":"5100691673", "check":false},{"id":"22992021-7D3B-4959-86B7-EF184B596AC6","name":"5100691674", "check":false},{"id":"48FBBE8E-594D-45D5-8C24-385C661C4A1C","name":"5100691675", "check":false},{"id":"4E429C60-325A-42ED-BEA3-B3397C07CCA1","name":"5100691668", "check":false}]}}} // if (action.action_type == 'open_common_dlg') { // var value = action.value; // if(value.common_dlg_id == 'check_list'){ - // $this.$data.check_list= value.config; + // $this.check_list= value.config; // } // } // var popupParam={ @@ -457,10 +457,10 @@ // req:"", // data_attr:data_attr // } - // $this.$data.popupParam= popupParam; + // $this.popupParam= popupParam; // return; - var before_click_button = $this.$data.classAttrList[index].Attr[iindex].before_click_button; - var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; + var before_click_button = $this.classAttrList[index].Attr[iindex].before_click_button; + var button_callback = $this.classAttrList[index].Attr[iindex].button_callback; if (!before_click_button) { uni.showModal({ title: "鎻愮ず", @@ -488,15 +488,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -504,7 +504,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -518,7 +518,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: "鎻愮ず", content: "popupParam涓虹┖锛�, @@ -527,9 +527,9 @@ }); return; } - $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex].Value = name; + $this.classAttrList[$this.popupParam.index].Attr[$this.popupParam.iindex].Value = name; console.log(data); - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -537,12 +537,12 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, cancel(e) { @@ -560,13 +560,13 @@ this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}` getApp().onScan((result) => { //console.log(result.decodedata); - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result.decodedata; uni.hideKeyboard(); this.onevent($ele, result.decodedata); if (result.decodedata) { //绗竴涓緭鍏ユ涓嶄负绌� //鍒濆鍖栵紝涓嬩釜杈撳叆妗唂ocus灞炴� - const attrs = this.$data.classAttrList[e.target.dataset['index']].Attr || [] + const attrs = this.classAttrList[e.target.dataset['index']].Attr || [] var findd = false for (let i = e.target.dataset['iindex'] + 1; i < attrs.length; i++) { const ele = attrs[i] @@ -642,28 +642,28 @@ }, onarrow(index, open) { // console.log(index+'--'+open); - this.$data.classAttrList[index].Open = open == true ? false : true; + this.classAttrList[index].Open = open == true ? false : true; }, ondateTime(e) { //console.log(e.target) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.target + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.target .value; }, onchange(e) { // console.log(e.target); - var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e - .target.value]; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var value = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e + .detail.value]; + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; if (value.Name != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value .Name; - // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + // console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -678,7 +678,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [] @@ -695,10 +695,10 @@ //涓虹┖鏃讹紝娓呯┖灞炴�value if (item.length == 0) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name) { - this.$data.classAttrList[i].Attr[j].Value = ""; + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) { + this.classAttrList[i].Attr[j].Value = ""; } } } @@ -706,26 +706,26 @@ for (var v in item) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (item[v].attr == this.$data.classAttrList[i].Attr[j].Name) { + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (item[v].attr == this.classAttrList[i].Attr[j].Name) { index = i; iindex = j; } } } var itemvalue = item[v]; - var data_attr = this.$data.classAttrList[index].Attr[iindex]; + var data_attr = this.classAttrList[index].Attr[iindex]; console.log(data_attr); if (itemvalue.Name != data_attr.Value) { - this.$data.classAttrList[index].Attr[iindex].Value = value; - // console.log(this.$data.classAttrList[index].Attr[iindex].Value); - var eventid = this.$data.classAttrList[index].Attr[iindex].action; + this.classAttrList[index].Attr[iindex].Value = value; + // console.log(this.classAttrList[index].Attr[iindex].Value); + var eventid = this.classAttrList[index].Attr[iindex].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -746,7 +746,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -760,17 +760,17 @@ }, onevent(e, decodedata) { // console.log(e.target); - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; // console.log(decodedata); - if (e.target.value != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = - decodedata ? decodedata : e.target.value; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + if (e.detail.value != data_attr.Value) { + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + decodedata ? decodedata : e.detail.value; + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -786,7 +786,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -799,16 +799,16 @@ oncheck(e) { // console.log(e.target); var ischecked = e.target.dataset.ischeck ? false : true; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; // console.log(data_attr); if (ischecked != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = ischecked; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = ischecked; + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -824,7 +824,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, dataJson: [], @@ -836,13 +836,13 @@ }, inputValListIsDel(index) { // console.log(index); - this.$data.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList); + this.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�+ // console.log(this.inputValList); }, addresschange(e) { // console.log(e.target); console.log(e.data.join(';')) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data.join( + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data.join( ';'); }, classAttr_AddPer(index, iindex) { @@ -857,11 +857,11 @@ AddPer(data, param) { // console.log(param); console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].Login + ';' + + $this.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[0].Login + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.classAttrList[param.index].Attr[param.iindex].action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -872,13 +872,13 @@ rclsid: "", robjid: "", userlogin: data[0].Login, - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: [], dataJson: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -894,8 +894,8 @@ showCancel: false, confirmText: "鍙栨秷" }); - // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; - // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; + // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; + // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; }, classAttr_AddPrj(index, iindex) { var param = { @@ -909,11 +909,11 @@ AddPer(data, param) { // console.log(param); // console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].ID + ';' + + $this.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[0].ID + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.classAttrList[param.index].Attr[param.iindex].action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -924,13 +924,13 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: [], dataJson: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -939,7 +939,7 @@ }); }, sava() { - if (this.$data.edit_ok_event) + if (this.edit_ok_event) this.OKDataObjRunCustomEvent(); else this.add(); @@ -950,7 +950,7 @@ mask: true }); var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -997,16 +997,16 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.clsid, + cls_id: this.param.clsid, } }; var dataInfo = { - class_id: this.$data.param.clsid, + class_id: this.param.clsid, data_obj_id: '', masterclsid: '', req: JSON.stringify(req), @@ -1063,8 +1063,8 @@ }); //鍒锋柊 uni.redirectTo({ - url: '../modal/classAttr?param=' + JSON.stringify(this.$data.param) + - "&titlename=" + this.$data.title + url: '../modal/classAttr?param=' + JSON.stringify(this.param) + + "&titlename=" + this.title }); //this.class_attr_init(); @@ -1080,15 +1080,15 @@ }); }, class_attr_init() { - const attrlist = this.$data.classGridStyle.StyleDef?.show_style || [] + const attrlist = this.classGridStyle.StyleDef?.show_style || [] var newattrlist = []; - if (this.$data.classAttrList.length > 0) { + if (this.classAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - for (var s = 0; s < this.$data.classAttrList.length; s++) { - var clsattr = this.$data.classAttrList[s]; + for (var s = 0; s < this.classAttrList.length; s++) { + var clsattr = this.classAttrList[s]; if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -1170,14 +1170,14 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.classGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith + control_style: this.classGridStyle.StyleDef.control_style, + title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith }) } } } if (newattrlist.length > 0) { - this.$data.classAttrList = newattrlist; + this.classAttrList = newattrlist; } var req = []; @@ -1192,25 +1192,25 @@ }); } } - var eventlist = this.$data.classGridStyle.StyleDef.event; + var eventlist = this.classGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -1218,15 +1218,15 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, } this.ini_DataObjRunCustomEvent(info); } - console.log(this.$data.classGridStyle); - console.log(this.$data.classAttrList); + console.log(this.classGridStyle); + console.log(this.classAttrList); } else { uni.showModal({ @@ -1239,16 +1239,16 @@ }, ini_DataObjRunCustomEvent(info) { var param = { - EditStyle: this.$data.param.Edit_dlg.Name, - ViewStyle: this.$data.param.Edit_dlg.Name, + EditStyle: this.param.Edit_dlg.Name, + ViewStyle: this.param.Edit_dlg.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } } @@ -1283,9 +1283,9 @@ if (value) { console.log(value); for (var i = 0; i < value.length; i++) { - for (var a = 0; a < this.$data.classAttrList.length; a++) { - for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { - var ca = this.$data.classAttrList[a].Attr[l]; + for (var a = 0; a < this.classAttrList.length; a++) { + for (var l = 0; l < this.classAttrList[a].Attr.length; l++) { + var ca = this.classAttrList[a].Attr[l]; if (value[i].attr == ca.Name) { if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; @@ -1309,16 +1309,16 @@ } var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.refdatastore.filter(function(s) { return value[i].attr == s.attr }).length) { length = 1; - this.$data.refdatastore.push(value[i]); + this.refdatastore.push(value[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == value[i].attr) { - this.$data.refdatastore[j].value = value[i].value; + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == value[i].attr) { + this.refdatastore[j].value = value[i].value; } } } @@ -1352,18 +1352,18 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; if (data_attr) { enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d + class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1389,7 +1389,7 @@ attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: "", - global_attr: JSON.stringify(this.$data.global_attr), + global_attr: JSON.stringify(this.global_attr), dataJson: JSON.stringify(info.dataJson) } console.log(dataInfo); @@ -1406,8 +1406,8 @@ var result = action.value; for (var i = 0; i < result.length; i++) { if (result[i].choice_list) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { @@ -1428,8 +1428,8 @@ } } } - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { console.log(attr[j].Name + '==' + result[i].attr); if (attr[j].Name == result[i].attr) { @@ -1438,22 +1438,22 @@ } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } } } else if (data.action[i].action_type == 'set_global_attr') { - $this.$data.global_attr = data.action[i].value || []; + $this.global_attr = data.action[i].value || []; } } } @@ -1461,8 +1461,8 @@ if (data.result) { var result = data.result; for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { attr[j].Value = result[i].value; @@ -1471,16 +1471,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -1500,18 +1500,18 @@ OKDataObjRunCustomEvent() { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id } }; - var eventid = this.$data.edit_ok_event.scrip_id; + var eventid = this.edit_ok_event.scrip_id; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1521,15 +1521,15 @@ } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { + if (this.refdatastore.length > 0) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name + return this.refdatastore[i].attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'value': this.$data.refdatastore[i].value + 'attr': this.refdatastore[i].attr, + 'value': this.refdatastore[i].value }); } } @@ -1541,7 +1541,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: "", attr: req, } @@ -1556,7 +1556,7 @@ objid: info.objid, attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), - global_attr: JSON.stringify(this.$data.global_attr) + global_attr: JSON.stringify(this.global_attr) } console.log(dataInfo); dataObjRunCustomEvent(dataInfo).then(data => { @@ -1565,16 +1565,16 @@ for (var i = 0; i < result.length; i++) { // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - this.$data.refdatastore.push(result[i]); + this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == result[i].attr) { - this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == result[i].attr) { + this.refdatastore[j].value = result[i].value; } } } @@ -1595,16 +1595,16 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1612,20 +1612,20 @@ req.push(this.formatAttr(ar)) } } - // if (this.$data.refdatastore.length > 0) { - // for (var i = 0; i < this.$data.refdatastore.length; i++) { + // if (this.refdatastore.length > 0) { + // for (var i = 0; i < this.refdatastore.length; i++) { // if (!req.filter(function (s) { - // return $this.$data.refdatastore[i].attr == s.name + // return $this.refdatastore[i].attr == s.name // }).length) { // length = 1; - // req.push({ 'attr': this.$data.refdatastore[i].attr, 'val': this.$data.refdatastore[i].value }); + // req.push({ 'attr': this.refdatastore[i].attr, 'val': this.refdatastore[i].value }); // } // } // } var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d + class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d } if (data_attr) { extinfo.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1645,11 +1645,11 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.clsid, + clsid: this.param.clsid, objid: '', attr: JSON.stringify(req), extinfo: JSON.stringify(extinfo), - global_attr: JSON.stringify(this.$data.global_attr) + global_attr: JSON.stringify(this.global_attr) } console.log(dataInfo); dataObjRunCustomEvent(dataInfo).then(data => { @@ -1696,7 +1696,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: param.req, inputparameter: data, @@ -1715,13 +1715,13 @@ } else if (action.action_type == 'open_common_dlg') { var $this = this; if (val.common_dlg_id == 'check_list') { - $this.$data.check_list = val.config; + $this.check_list = val.config; if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.$data.popupType = 'right'; + $this.popupType = 'right'; else - $this.$data.popupType = 'center' + $this.popupType = 'center' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.$data.popupType); + $this.$refs.popup.open($this.popupType); var popupParam = { index: index, iindex: iindex, @@ -1729,7 +1729,7 @@ req: req, data_attr: data_attr } - $this.$data.popupParam = popupParam; + $this.popupParam = popupParam; } } else if (action.action_type == 'open_project_query_dlg') { //console.log(action.value.select_range); @@ -1761,9 +1761,9 @@ .stringify(param_), events: { AddPer(data, param) { - $this.$data.classAttrList[param.index].Attr[param + $this.classAttrList[param.index].Attr[param .iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param + $this.classAttrList[param.index].Attr[param .iindex].ValID = data[0].ID + ';' + data[0] .Name; var callback_eventid = param.button_callback.trim(); @@ -1775,7 +1775,7 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.clsid, + clsid: $this.param.clsid, objid: "", attr: param.req, dataJson: [], diff --git a/pages/modal/form/index.vue b/pages/modal/form/index.vue index e50b6c3..1d2c903 100644 --- a/pages/modal/form/index.vue +++ b/pages/modal/form/index.vue @@ -3,11 +3,11 @@ <view class="view-content"> <!-- 琛ㄥご鏍峰紡 --> <OIForm ref="refBaseForm" class="v-head-style" :form="head_styledef.form" :focusId="focusFieldId" - @click="onClick" @focus="ontap" @change="onEnterChange" @click-prefix="classAttr_extButton" - @click-suffix="classAttr_extButton"></OIForm> + @on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" + @on-click-suffix="classAttr_extButton"></OIForm> </view> <view class="view-bottom"> - <button type="primary" @tap="ok" class="btn_add" :class="okLoading?'btn_disabled':''" + <button type="primary" @tap="onClickOk" class="btn_add" :class="okLoading?'btn_disabled':''" :disabled="okLoading">{{translateSys('ok')}}</button> <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> @@ -41,7 +41,9 @@ </template> <script> - import Base64 from '../../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import { dictGetInfo } from "@/api/mobox.js" @@ -54,12 +56,11 @@ } from "@/api/data.js" import dayjs from "dayjs"; import OIForm from '@/components/oi-form/index.vue' + import buttonClickMixin from '@/mixins/button-click.js'; export default { name: "PageModalForm", - modules: { - Base64, - }, + mixins: [buttonClickMixin], components: { OIForm }, @@ -83,7 +84,6 @@ global_attr: [], ext_info: {}, data_json: [], - refdatastore: [], //寮曠敤鏁版嵁瀛樺偍鍖�/ {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} popupType: "center", check_list: {}, popupParam: {}, @@ -624,8 +624,12 @@ let newVal = item.value if (typeof item.value == "string") { newVal = item.value.trim() - if (!newVal) + if (!newVal) { + item.oldvalue = newVal; + var attr = item.fieldId; + this.head_styledef.form.model[attr] = newVal; return + } } if (item.oldvalue != newVal) { item.oldvalue = newVal; @@ -660,7 +664,7 @@ }); return; } - this.$data.popupType = 'right' + this.popupType = 'right' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� this.$refs.popup.open(this.popupType); @@ -910,15 +914,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -926,7 +930,7 @@ }, popup_sava(e) { //寮规纭畾 var $this = this; - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -940,7 +944,7 @@ }); } } - if (!$this.$data.popupParam) { + if (!$this.popupParam) { uni.showModal({ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, @@ -961,7 +965,7 @@ let global_attr = Base64.encode(JSON.stringify(this.global_attr)) let data_json = Base64.encode(JSON.stringify(this.data_json)) let ext_info = Base64.encode(JSON.stringify(this.ext_info)) - var callback_eventid = $this.$data.popupParam.button_callback.trim(); + var callback_eventid = $this.popupParam.button_callback.trim(); var info = { eventid: callback_eventid, edtype: "0", @@ -971,10 +975,10 @@ userlogin: '', clsid: $this.clsId, objid: "", - attr: $this.$data.popupParam.req, + attr: $this.popupParam.req, dataJson: data } - $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); + $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); this.$refs.popup.close(); }, @@ -1086,7 +1090,7 @@ } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; result.forEach(async (attr, key) => { - $this.$data.head_styledef.form.items + $this.head_styledef.form.items .forEach( async (ele, index) => { @@ -1119,11 +1123,11 @@ }); var head_styledef = JSON.parse(JSON.stringify($this.$data .head_styledef)); - $this.$data.head_styledef = []; - $this.$data.head_styledef = head_styledef; - // console.log($this.$data.head_styledef); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + // console.log($this.head_styledef); } else if (action.action_type == 'set_global_attr') { - $this.$data.global_attr = action.value || []; + $this.global_attr = action.value || []; } else { uni.showModal({ title: this.translateSys("tip"), @@ -1142,63 +1146,7 @@ } console.log($this.head_styledef); if (data.result) { - var result = data.result; - for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.head_styledef.form.items - .length; c++) { - var attr = $this.$data.head_styledef.form.items[c]; - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = - result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = - result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = - result[i].value; - } - } - }); - } - } - - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i] - .attr) { - $this.$data.refdatastore[j].value = result[i] - .value; - } - } - } - } + $this.setFormValues(data.result) } } @@ -1235,18 +1183,6 @@ attr: a, value: obj_attr[a] || "", })); - if ($this.refdatastore.length > 0) { - for (var i = 0; i < $this.refdatastore.length; i++) { - if (!req.filter(function(s) { - return $this.refdatastore[i].attr == s.name - }).length) { - req.push({ - 'attr': $this.refdatastore[i].attr, - 'value': $this.refdatastore[i].value - }); - } - } - } let global_attr = Base64.encode(JSON.stringify(this.global_attr)) let data_json = Base64.encode(JSON.stringify(this.data_json)) let ext_info = Base64.encode(JSON.stringify(this.ext_info)) @@ -1458,8 +1394,8 @@ data[0].ID + ';' + data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; var callback_eventid = param .button_callback .trim(); @@ -1525,6 +1461,12 @@ }); }); }, + onClickOK() { + this.handleButtonClick(async (done) => { + await this.ok() + done(); // 閲嶇疆鐘舵� + }); + }, //纭畾 async ok() { try { @@ -1536,11 +1478,13 @@ var obj_attr = this.head_styledef.form.model || {}; console.log(obj_attr) let ret = await this.sava(); + this.okLoading = false uni.hideLoading(); if (!ret) return; obj_attr.id = this.objId || ""; - const eventChannel = this.$scope.eventChannel; + console.log(this.$scope) + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, obj_attr); @@ -1581,6 +1525,8 @@ } return true; } catch (ex) { + console.log("sava", ex) + this.showError(ex) return false; } @@ -1861,6 +1807,14 @@ return false } }, + showError(ex) { + uni.showModal({ + title: this.translateSys('error'), + content: typeof ex == "string" ? ex : typeof ex.errMsg == "string" ? ex.errMsg : "", + showCancel: false, + confirmText: this.translateSys('cancel') + }) + }, translate(t) { if (typeof this.$t == "function") return this.$t( `page.${t}`) diff --git a/pages/modal/ms_classAttr.vue b/pages/modal/ms_classAttr.vue index 0745715..61959ae 100644 --- a/pages/modal/ms_classAttr.vue +++ b/pages/modal/ms_classAttr.vue @@ -31,20 +31,18 @@ <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'" :value="attr.Value" :focus="focusField ==`${index}-${iindex}`" @focus="ontap" - @click="onClick(index,iindex)" @blur="onevent" - v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" - :style="{'width':attr.Width}" :disabled="attr.edit?false:true"> + @click="onClick(index,iindex)" @blur="onevent" v-if="attr.Height=='1'" + :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" + :disabled="attr.edit?false:true"> <!-- =='flase'?true:false --> <textarea :value="attr.Value" :focus="focusField == `${index}-${iindex}`" @focus="ontap" - @click="onClick(index,iindex)" @blur="onevent" - v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex" - style="height:60px;" :style="{'width':attr.Width}" - :disabled="attr.edit?false:true"></textarea> + @click="onClick(index,iindex)" @blur="onevent" v-else-if="attr.Height=='2'" + :data-index="index" :data-iindex="iindex" style="height:60px;" + :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> <textarea :value="attr.Value" :focus="focusField == `${index}-${iindex}`" @focus="ontap" - @click="onClick(index,iindex)" @blur="onevent" - v-else-if="attr.Height=='3'" :data-index="index" :data-iindex="iindex" - style="height:90px;" :style="{'width':attr.Width}" - :disabled="attr.edit?false:true"></textarea> + @click="onClick(index,iindex)" @blur="onevent" v-else-if="attr.Height=='3'" + :data-index="index" :data-iindex="iindex" style="height:90px;" + :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> <!-- </div> --> </view> <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> @@ -706,7 +704,7 @@ title: options.titlename }); //璁剧疆椤堕儴鏍囬 var param = JSON.parse(options.param); - this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 + this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧 console.log(param); if (!param.Master_Cls.View_Style) { uni.showModal({ @@ -726,7 +724,7 @@ }); return; } - this.$data.param = param; + this.param = param; // var edit_dlg = { // Model: param.EditDlgMode, // Name: param.Master_Cls.View_Style.Name @@ -760,14 +758,14 @@ try { const param = this.param - this.$data.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) - this.$data.classGridStyle = await this.classGridStyleInfo(param.Master_Cls?.ID, param.Master_Cls + this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) + this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls?.ID, param.Master_Cls ?.View_Style?.Name) this.class_attr_init(); - this.$data.subClassAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) - this.$data.subClassGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls + this.subClassAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) + this.subClassGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls ?.View_Style ?.Name) this.subClass_attr_init(); @@ -784,7 +782,7 @@ }, scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this; - var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event; + var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; if (!Before_Select_Event) { uni.showModal({ title: "鎻愮ず", @@ -795,7 +793,7 @@ return; } var mast_attr = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -830,7 +828,7 @@ } var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var sub_req = []; for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { @@ -879,25 +877,25 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } }; var req = []; - // var subPanelList = $this.$data.subPanelList; + // var subPanelList = $this.subPanelList; // for (var s = 0; s < subPanelList.length; s++) { // var json = {}; // for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { @@ -917,7 +915,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: [], global_attr: req, @@ -935,15 +933,15 @@ // console.log(e.target.dataset); var index = e.target.dataset.index; var ischeck = e.target.dataset.ischeck; - var data = this.$data.check_list.items; - // this.$data.check_list.items=[]; - if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items; + // this.check_list.items=[]; + if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) { data[i].check = false; } } data[index].check = ischeck ? false : true; - this.$data.check_list.items = data; + this.check_list.items = data; }, popup_cancel(e) { //寮规鍙栨秷 @@ -951,7 +949,7 @@ }, popup_sava(e) { //寮规纭畾 閫夋嫨鎸夐挳鍚� var $this = this; - var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event; + var After_Select_Event = $this.param.Scan_Code.After_Select_Event; if (!After_Select_Event) { uni.showModal({ title: "鎻愮ず", @@ -961,7 +959,7 @@ }); return; } - var items = $this.$data.check_list.items; + var items = $this.check_list.items; var data = []; var name = ""; for (var i = 0; i < items.length; i++) { @@ -985,7 +983,7 @@ return; } var mast_attr = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1003,7 +1001,7 @@ } } - $this.$data.scanCodeVal = name; + $this.scanCodeVal = name; var info = { eventid: After_Select_Event.ID, edtype: "7", @@ -1032,15 +1030,15 @@ }, panel_del(index) { var $this = this; - if (this.$data.subPanelList[index].scanCodeVal == this.$data.scanCodeVal) { - this.$data.scanCodeVal = ''; + if (this.subPanelList[index].scanCodeVal == this.scanCodeVal) { + this.scanCodeVal = ''; } - if (!this.$data.subPanelList[index].ObjID) - this.$data.subPanelList.splice(index, 1); + if (!this.subPanelList[index].ObjID) + this.subPanelList.splice(index, 1); else { var dataInfo = { - clsId: this.$data.param.Sub_Cls.ID, - objId: this.$data.subPanelList[index].ObjID + clsId: this.param.Sub_Cls.ID, + objId: this.subPanelList[index].ObjID }; console.log(dataInfo); // return; @@ -1049,7 +1047,7 @@ }); dataObjDelele(dataInfo).then(success => { uni.hideLoading(); - $this.$data.subPanelList.splice(index, 1); + $this.subPanelList.splice(index, 1); uni.showModal({ title: "鎻愮ず", content: "鍒犻櫎鎴愬姛锛�, @@ -1126,32 +1124,32 @@ onClick(index, iindex) { this.focusField = `${index}-${iindex}` - console.log("onClick", this.focusField) + console.log("onClick", this.focusField) }, - + ontap(e) { //鎵爜鍔熻兘 //console.log(e.target) this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}` getApp().onScan((result) => { //console.log(result.decodedata); - var isVal = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Value; // if(!isVal){ - // this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; - // var isVald =this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; + // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; + // var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; // return; // } //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 if (isVal != result.decodedata) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .Value = result.decodedata; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var req = []; - var attrlist = this.$data.classAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.classAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1167,7 +1165,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: req, @@ -1181,14 +1179,14 @@ } if (result.decodedata) { //绗竴涓緭鍏ユ涓嶄负绌� //鍒濆鍖栵紝涓嬩釜杈撳叆妗唂ocus灞炴� - const attrs = this.$data.classAttrList[e.target.dataset['index']].Attr || [] + const attrs = this.classAttrList[e.target.dataset['index']].Attr || [] var findd = false for (let i = e.target.dataset['iindex'] + 1; i < attrs.length; i++) { const ele = attrs[i] if (ele.hidden != true) { if (utils.classUtils.attrTypeIsString(ele.Type) || utils.classUtils - .attrTypeIsInt(ele.Type)) { + .attrTypeIsInt(ele.Type)) { const field = `${e.target.dataset['index']}-${i}` if (this .focusOldField == @@ -1259,20 +1257,20 @@ //console.log(e.target) getApp().onScan((result) => { //console.log(result.decodedata); - var isVal = this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target + var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e.target .dataset[ 'iindex']].Value; //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 if (isVal != result.decodedata) { - this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .Value = result.decodedata; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var req = []; - var attrlist = this.$data.subClassAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.subClassAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1287,7 +1285,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: [], @@ -1307,19 +1305,19 @@ getApp().onScan((result) => { console.log(result.decodedata); var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == result.decodedata) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == result.decodedata) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = result.decodedata; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = result.decodedata; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var mast_req = []; //涓绘暟鎹被灞炴� - var classattrlist = this.$data.classAttrList; + var classattrlist = this.classAttrList; for (var i = 0; i < classattrlist.length; i++) { var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1329,7 +1327,7 @@ } var req = []; //瀛愭暟鎹被灞炴� - var attrlist = this.$data.subClassAttrList; + var attrlist = this.subClassAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1344,13 +1342,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: mast_req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1361,21 +1359,21 @@ }, scan_onevent(e) { // console.log(e.target); - if (e.target.value) { + if (e.detail.value) { var isflag = true; - for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == e.target.value) + for (var i in this.subPanelList) { + if (this.subPanelList[i].scanCodeVal == e.detail.value) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = e.target.value; - var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + this.scanCodeVal = e.detail.value; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var mast_req = []; //涓绘暟鎹被灞炴� - var classattrlist = this.$data.classAttrList; + var classattrlist = this.classAttrList; for (var i = 0; i < classattrlist.length; i++) { var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1385,7 +1383,7 @@ } var req = []; //瀛愭暟鎹被灞炴� - var attrlist = this.$data.subClassAttrList; + var attrlist = this.subClassAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1400,13 +1398,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: mast_req, inputParamter: [{ attr: 'input_3037', - value: this.$data.scanCodeVal + value: this.scanCodeVal }] } @@ -1417,55 +1415,55 @@ }, onarrow(index, open) { // console.log(index+'--'+open); - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Open; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] .Attr[e .target.dataset['iindex']].Value = open == true ? false : true; return; } - this.$data.classAttrList[e.target.dataset['iiindex']].subClassAttr[index].Open = open == true ? + this.classAttrList[e.target.dataset['iiindex']].subClassAttr[index].Open = open == true ? false : true; }, ondateTime(e) { //console.log(e.target) - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Value; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] .Attr[e - .target.dataset['iindex']].Value = e.target.value; + .target.dataset['iindex']].Value = e.detail.value; return; } - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e .target .value; }, onchange(e) { console.log(e.target); - var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + var value = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .dictitem[e - .target.value]; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + .detail.value]; + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value .Name; - console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .Value); - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1480,7 +1478,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } @@ -1495,10 +1493,10 @@ // console.log(delvalue); if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name) { - this.$data.classAttrList[i].Attr[j].Value = ""; + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) { + this.classAttrList[i].Attr[j].Value = ""; } } } @@ -1506,26 +1504,26 @@ for (var v in item) { var index, iindex, dindex = 0; - for (var i in this.$data.classAttrList) { - for (var j in this.$data.classAttrList[i].Attr) { - if (item[v].attr == this.$data.classAttrList[i].Attr[j].Name) { + for (var i in this.classAttrList) { + for (var j in this.classAttrList[i].Attr) { + if (item[v].attr == this.classAttrList[i].Attr[j].Name) { index = i; iindex = j; } } } var itemvalue = item[v]; - var data_attr = this.$data.classAttrList[index].Attr[iindex]; + var data_attr = this.classAttrList[index].Attr[iindex]; console.log(data_attr); if (itemvalue.Name != data_attr.Value) { - this.$data.classAttrList[index].Attr[iindex].Value = value; - console.log(this.$data.classAttrList[index].Attr[iindex].Value); - var eventid = this.$data.classAttrList[index].Attr[iindex].action; + this.classAttrList[index].Attr[iindex].Value = value; + console.log(this.classAttrList[index].Attr[iindex].Value); + var eventid = this.classAttrList[index].Attr[iindex].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1546,7 +1544,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } @@ -1559,25 +1557,25 @@ }, sub_onchange(e) { console.log(e.target); - var value = this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ + var value = this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ 'index']] - .Attr[e.target.dataset['iindex']].dictitem[e.target.value]; - var data_attr = this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ + .Attr[e.target.dataset['iindex']].dictitem[e.detail.value]; + var data_attr = this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']]; console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] .Attr[e .target.dataset['iindex']].Value = value.Name; - console.log(this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ + console.log(this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset[ 'index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target + var eventid = this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target .dataset[ 'index']].Attr[e.target.dataset['iindex']].action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr; + var attrlist = this.subPanelList[e.target.dataset['iiindex']].subClassAttr; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1592,7 +1590,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Sub_Cls.ID, + clsid: this.param.Sub_Cls.ID, objid: "", attr: req, } @@ -1605,7 +1603,7 @@ // console.log(item); // console.log(value); // console.log(delvalue); - var subClassAttr = this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr; + var subClassAttr = this.subPanelList[e.target.dataset['iiindex']].subClassAttr; if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value var index, iindex, dindex = 0; for (var i in subClassAttr) { @@ -1664,7 +1662,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Sub_Cls.ID, + clsid: this.param.Sub_Cls.ID, objid: "", attr: req, } @@ -1677,26 +1675,26 @@ }, onevent(e) { // console.log(e.target); - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] .Attr[e - .target.dataset['iindex']].Value = e.target.value; + .target.dataset['iindex']].Value = e.detail.value; return; } // console.log(data_attr); - if (e.target.value != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e + if (e.detail.value != data_attr.Value) { + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e .target .value; - // var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; + // var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; + var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.classAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1711,13 +1709,13 @@ rclsid: '', robjid: '', userlogin: '', - clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, + clsid: 'MBOX', //this.param.Sub_Cls.ID, objid: "", attr: req, mast_attr: req, inputParamter: [{ attr: 'mast_input_3037', - value: e.target.value + value: e.detail.value }] } @@ -1729,25 +1727,25 @@ oncheck(e) { // console.log(e.target); var ischecked = e.target.dataset.ischeck ? false : true; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; if (!data_attr) { - this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] + this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']] .Attr[e .target.dataset['iindex']].Value = ischecked; return; } // console.log(data_attr); if (ischecked != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = ischecked; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1763,7 +1761,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } @@ -1774,20 +1772,20 @@ }, inputValListIsDel(index) { // console.log(index); - this.$data.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList); + this.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�+ // console.log(this.inputValList); }, addresschange(e) { // console.log(e.target); console.log(e.data.join(';')) - this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e + this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e .data .join(';'); }, classAttr_extButton(index, iindex) { var $this = this; - var before_click_button = $this.$data.classAttrList[index].Attr[iindex].before_click_button; - var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; + var before_click_button = $this.classAttrList[index].Attr[iindex].before_click_button; + var button_callback = $this.classAttrList[index].Attr[iindex].button_callback; if (!before_click_button) { uni.showModal({ title: "鎻愮ず", @@ -1806,7 +1804,7 @@ }); return; } - var data_attr = this.$data.classAttrList[index].Attr[iindex]; + var data_attr = this.classAttrList[index].Attr[iindex]; this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index, iindex); }, classAttr_AddPer(index, iindex) { @@ -1821,12 +1819,12 @@ AddPer(data, param) { // console.log(param); console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0] + $this.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[0] .Login + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.classAttrList[param.index].Attr[param.iindex].action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -1837,12 +1835,12 @@ rclsid: "", robjid: "", userlogin: data[0].Login, - clsid: $this.$data.param.Master_Cls.ID, + clsid: $this.param.Master_Cls.ID, objid: "", attr: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -1858,8 +1856,8 @@ showCancel: false, confirmText: "鍙栨秷" }); - // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; - // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; + // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; + // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; }, classAttr_AddPrj(index, iindex) { var param = { @@ -1873,12 +1871,12 @@ AddPer(data, param) { // console.log(param); // console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].ID + + $this.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; + $this.classAttrList[param.index].Attr[param.iindex].ValID = data[0].ID + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.classAttrList[param.index].Attr[param.iindex].action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -1889,12 +1887,12 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.Master_Cls.ID, + clsid: $this.param.Master_Cls.ID, objid: "", attr: [], } - // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; + // var data_attr = $this.classAttrList[param.index].Attr[param.iindex]; $this.DataObjRunCustomEvent(info); } } @@ -1903,20 +1901,20 @@ }); }, sava() { - if (this.$data.param.Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�- this.scan_OKDataObjRunCustomEvent(this.$data.param.Before_OK_Event.ID); - else if (this.$data.param.After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�- this.scan_OKDataObjRunCustomEvent(this.$data.param.After_OK_Event.ID); + if (this.param.Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�+ this.scan_OKDataObjRunCustomEvent(this.param.Before_OK_Event.ID); + else if (this.param.After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�+ this.scan_OKDataObjRunCustomEvent(this.param.After_OK_Event.ID); else uni.navigateBack({ delta: 1 }); //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }, trigger() { - if (this.$data.param.Before_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍓嶈剼鏈�- this.scan_TriggerDataObjRunCustomEvent(this.$data.param.Before_Trigger_Event.ID); - else if (this.$data.param.After_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍚庤剼鏈�- this.scan_TriggerDataObjRunCustomEvent(this.$data.param.After_Trigger_Event.ID); + if (this.param.Before_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍓嶈剼鏈�+ this.scan_TriggerDataObjRunCustomEvent(this.param.Before_Trigger_Event.ID); + else if (this.param.After_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍚庤剼鏈�+ this.scan_TriggerDataObjRunCustomEvent(this.param.After_Trigger_Event.ID); elsess uni.navigateBack({ delta: 1 @@ -1928,7 +1926,7 @@ mask: true }); var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -1975,16 +1973,16 @@ } var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Master_Cls.ID, + cls_id: this.param.Master_Cls.ID, } }; var dataInfo = { - class_id: this.$data.param.Master_Cls.ID, + class_id: this.param.Master_Cls.ID, data_obj_id: '', masterclsid: '', req: JSON.stringify(req), @@ -2014,8 +2012,8 @@ } //鍒锋柊 uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify(this.$data.param) + - "&titlename=" + this.$data.title + url: '../modal/ms_classAttr?param=' + JSON.stringify(this.param) + + "&titlename=" + this.title }); // // this.class_attr_init(); @@ -2031,18 +2029,18 @@ }); }, class_attr_init() { - const attrlist = this.$data.classGridStyle.StyleDef?.show_style || [] + const attrlist = this.classGridStyle.StyleDef?.show_style || [] var newattrlist = []; - if (this.$data.classAttrList.length > 0) { + if (this.classAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - - for (var s = 0; s < this.$data.classAttrList.length; s++) { - var clsattr = this.$data.classAttrList[s]; - + + for (var s = 0; s < this.classAttrList.length; s++) { + var clsattr = this.classAttrList[s]; + if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -2123,7 +2121,7 @@ } } } - + newattrlist.push({ BkColor: clsattr.BkColor, HasAce: clsattr.HasAce, @@ -2132,14 +2130,14 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.classGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith, - Font: this.$data.classGridStyle.StyleDef.Font ? this.$data + control_style: this.classGridStyle.StyleDef.control_style, + title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith, + Font: this.classGridStyle.StyleDef.Font ? this.$data .classGridStyle .StyleDef.Font : {}, - Bk_Color: this.$data.classGridStyle.StyleDef.Bk_Color ? this.$data + Bk_Color: this.classGridStyle.StyleDef.Bk_Color ? this.$data .classGridStyle.StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.$data.classGridStyle.StyleDef.Text_Color ? this.$data + Text_Color: this.classGridStyle.StyleDef.Text_Color ? this.$data .classGridStyle.StyleDef.Text_Color : '#000000' }) } @@ -2147,7 +2145,7 @@ } } if (newattrlist.length > 0) { - this.$data.classAttrList = newattrlist; + this.classAttrList = newattrlist; } var req = []; @@ -2161,24 +2159,24 @@ }); } } - var eventlist = this.$data.classGridStyle.StyleDef.event; + var eventlist = this.classGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } // console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -2186,14 +2184,14 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } this.ini_DataObjRunCustomEvent(info); } - // console.log(this.$data.classGridStyle); - // console.log(this.$data.classAttrList); + // console.log(this.classGridStyle); + // console.log(this.classAttrList); } else { uni.showModal({ @@ -2205,15 +2203,15 @@ } }, subClass_attr_init() { - var attrlist = this.$data.subClassGridStyle.StyleDef.show_style || [] + var attrlist = this.subClassGridStyle.StyleDef.show_style || [] var newattrlist = []; - if (this.$data.subClassAttrList.length > 0) { + if (this.subClassAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { var open = attrlist[i].open; var name = attrlist[i].attrgroup_name; var attrs = attrlist[i].attrs; - for (var s = 0; s < this.$data.subClassAttrList.length; s++) { - var clsattr = this.$data.subClassAttrList[s]; + for (var s = 0; s < this.subClassAttrList.length; s++) { + var clsattr = this.subClassAttrList[s]; if (name == clsattr.Name) { var attr = []; for (var j = 0; j < attrs.length; j++) { @@ -2287,14 +2285,14 @@ Order: clsattr.Order, Open: open, Attr: attr, - control_style: this.$data.subClassGridStyle.StyleDef.control_style, - title_p_wdith: this.$data.subClassGridStyle.StyleDef.title_p_wdith, - Font: this.$data.subClassGridStyle.StyleDef.Font ? this.$data + control_style: this.subClassGridStyle.StyleDef.control_style, + title_p_wdith: this.subClassGridStyle.StyleDef.title_p_wdith, + Font: this.subClassGridStyle.StyleDef.Font ? this.$data .subClassGridStyle .StyleDef.Font : {}, - Bk_Color: this.$data.subClassGridStyle.StyleDef.Bk_Color ? this.$data + Bk_Color: this.subClassGridStyle.StyleDef.Bk_Color ? this.$data .subClassGridStyle.StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.$data.subClassGridStyle.StyleDef.Text_Color ? this + Text_Color: this.subClassGridStyle.StyleDef.Text_Color ? this .$data .subClassGridStyle.StyleDef.Text_Color : '#000000' }) @@ -2302,7 +2300,7 @@ } } if (newattrlist.length > 0) { - this.$data.subClassAttrList = newattrlist; + this.subClassAttrList = newattrlist; } var req = []; if (attrlist.length > 0) { @@ -2320,24 +2318,24 @@ } } } - var eventlist = this.$data.subClassGridStyle.StyleDef.event; + var eventlist = this.subClassGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { if (eventlist[i].event_id == 'before_ok') { - this.$data.edit_ok_event = eventlist[i]; + this.edit_ok_event = eventlist[i]; } else if (eventlist[i].event_id == 'initial') { - this.$data.edit_inital_event = eventlist[i]; + this.edit_inital_event = eventlist[i]; } else if (eventlist[i].event_id == 'before_select_compose') { - this.$data.edit_select_compose_event = eventlist[i].scrip_id; - this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; + this.edit_select_compose_event = eventlist[i].scrip_id; + this.edit_compose_cls_id = eventlist[i].compose_cls_id; } } } } // console.log(req); - if (this.$data.edit_inital_event) { - var eventid = this.$data.edit_inital_event.scrip_id; + if (this.edit_inital_event) { + var eventid = this.edit_inital_event.scrip_id; var info = { eventid: eventid, edtype: "0", @@ -2345,14 +2343,14 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Sub_Cls.ID, + clsid: this.param.Sub_Cls.ID, objid: "", attr: req, } this.scan_ini_DataObjRunCustomEvent(info); } - console.log(this.$data.subClassGridStyle); - console.log(this.$data.subClassAttrList); + console.log(this.subClassGridStyle); + console.log(this.subClassAttrList); } else { uni.showModal({ @@ -2365,16 +2363,16 @@ }, ini_DataObjRunCustomEvent(info) { var param = { - EditStyle: this.$data.param.Master_Cls.View_Style.Name, - ViewStyle: this.$data.param.Master_Cls.View_Style.Name, + EditStyle: this.param.Master_Cls.View_Style.Name, + ViewStyle: this.param.Master_Cls.View_Style.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } } @@ -2413,10 +2411,10 @@ } console.log(val); for (var i = 0; i < val.length; i++) { - for (var a = 0; a < this.$data.classAttrList.length; a++) { - for (var l = 0; l < this.$data.classAttrList[a].Attr + for (var a = 0; a < this.classAttrList.length; a++) { + for (var l = 0; l < this.classAttrList[a].Attr .length; l++) { - var ca = this.$data.classAttrList[a].Attr[l]; + var ca = this.classAttrList[a].Attr[l]; if (val[i].attr == ca.Name) { if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; @@ -2440,16 +2438,16 @@ } var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.refdatastore.filter(function(s) { return val[i].attr == s.attr }).length) { length = 1; - this.$data.refdatastore.push(val[i]); + this.refdatastore.push(val[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == val[i].attr) { - this.$data.refdatastore[j].value = val[i].value; + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == val[i].attr) { + this.refdatastore[j].value = val[i].value; } } } @@ -2481,17 +2479,17 @@ var $this = this; var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; enviroment.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d + class_id: this.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -2516,7 +2514,7 @@ attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', - global_attr: JSON.stringify(this.$data.global_attr) + global_attr: JSON.stringify(this.global_attr) } console.log(dataInfo); dataObjRunCustomEvent(dataInfo).then(success => { @@ -2532,8 +2530,8 @@ var result = action.value; for (var i = 0; i < result.length; i++) { if (result[i].choice_list) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { @@ -2554,8 +2552,8 @@ } } } - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { console.log(attr[j].Name + '==' + result[i].attr); if (attr[j].Name == result[i].attr) { @@ -2564,22 +2562,22 @@ } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } } } else if (data.action[i].action_type == 'set_global_attr') { - $this.$data.global_attr = data.action[i].value || []; + $this.global_attr = data.action[i].value || []; } } } @@ -2587,8 +2585,8 @@ if (data.result) { var result = data.result; for (var i = 0; i < result.length; i++) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { - var attr = $this.$data.classAttrList[c].Attr; + for (var c = 0; c < $this.classAttrList.length; c++) { + var attr = $this.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { attr[j].Value = result[i].value; @@ -2597,16 +2595,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -2626,18 +2624,18 @@ OKDataObjRunCustomEvent() { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id } }; - var eventid = this.$data.edit_ok_event.scrip_id; + var eventid = this.edit_ok_event.scrip_id; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -2648,15 +2646,15 @@ } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { + if (this.refdatastore.length > 0) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name + return this.refdatastore[i].attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'value': this.$data.refdatastore[i].value + 'attr': this.refdatastore[i].attr, + 'value': this.refdatastore[i].value }); } } @@ -2668,7 +2666,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: "", attr: req, } @@ -2683,7 +2681,7 @@ objid: info.objid, attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), - global_attr: JSON.stringify(this.$data.global_attr) + global_attr: JSON.stringify(this.global_attr) } console.log(dataInfo); dataObjRunCustomEvent(dataInfo).then(success => { @@ -2693,16 +2691,16 @@ for (var i = 0; i < result.length; i++) { // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - this.$data.refdatastore.push(result[i]); + this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == result[i].attr) { - this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == result[i].attr) { + this.refdatastore[j].value = result[i].value; } } } @@ -2723,16 +2721,16 @@ DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) { var enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Master_Cls.ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } }; var req = []; - var attrlist = this.$data.classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -2740,15 +2738,15 @@ req.push(this.formatAttr(ar)) } } - if (this.$data.refdatastore.length > 0) { - for (var i = 0; i < this.$data.refdatastore.length; i++) { + if (this.refdatastore.length > 0) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data.refdatastore[i].attr == s.name + return this.refdatastore[i].attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data.refdatastore[i].attr, - 'value': this.$data.refdatastore[i].value + 'attr': this.refdatastore[i].attr, + 'value': this.refdatastore[i].value }); } } @@ -2756,7 +2754,7 @@ var extinfo = enviroment; extinfo.edit_dlg = { type: 'small', //灏忕獥鍙�- class_id: this.$data.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d + class_id: this.param.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d } if (data_attr) { extinfo.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -2776,11 +2774,11 @@ rclsid: '', robjid: '', userlogin: '', - clsid: this.$data.param.Master_Cls.ID, + clsid: this.param.Master_Cls.ID, objid: '', attr: JSON.stringify(req), extinfo: JSON.stringify(extinfo), - global_attr: JSON.stringify(this.$data.global_attr) + global_attr: JSON.stringify(this.global_attr) } console.log(dataInfo); dataObjRunCustomEvent(dataInfo).then(success => { @@ -2830,7 +2828,7 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.Master_Cls.ID, + clsid: $this.param.Master_Cls.ID, objid: "", attr: param.req, inputparameter: data @@ -2880,9 +2878,9 @@ .stringify(param_), events: { AddPer(data, param) { - $this.$data.classAttrList[param.index].Attr[param + $this.classAttrList[param.index].Attr[param .iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param + $this.classAttrList[param.index].Attr[param .iindex].ValID = data[0].ID + ';' + data[0] .Name; var callback_eventid = param.button_callback @@ -2895,7 +2893,7 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.Master_Cls.ID, + clsid: $this.param.Master_Cls.ID, objid: "", attr: param.req, } @@ -2936,16 +2934,16 @@ }, scan_ini_DataObjRunCustomEvent(info) { var param = { - EditStyle: this.$data.param.Sub_Cls.View_Style.Name, - ViewStyle: this.$data.param.Sub_Cls.View_Style.Name, + EditStyle: this.param.Sub_Cls.View_Style.Name, + ViewStyle: this.param.Sub_Cls.View_Style.Name, NotTriggerSysEvent: 0, enviroment: { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.Sub_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', master: { - cls_id: this.$data.param.Sub_Cls.ID, // button=bottom鏃�master鐨刢ls_id + cls_id: this.param.Sub_Cls.ID, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id } } @@ -2985,10 +2983,10 @@ } console.log(val); for (var i = 0; i < val.length; i++) { - for (var a = 0; a < this.$data.subClassAttrList.length; a++) { - for (var l = 0; l < this.$data.subClassAttrList[a].Attr + for (var a = 0; a < this.subClassAttrList.length; a++) { + for (var l = 0; l < this.subClassAttrList[a].Attr .length; l++) { - var ca = this.$data.subClassAttrList[a].Attr[l]; + var ca = this.subClassAttrList[a].Attr[l]; if (val[i].attr == ca.Name) { if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; @@ -3012,16 +3010,16 @@ } var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.refdatastore.filter(function(s) { return val[i].attr == s.attr }).length) { length = 1; - this.$data.refdatastore.push(val[i]); + this.refdatastore.push(val[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == val[i].attr) { - this.$data.refdatastore[j].value = val[i].value; + for (var j = 0; j < this.refdatastore.length; j++) { + if (this.refdatastore[j].attr == val[i].attr) { + this.refdatastore[j].value = val[i].value; } } } @@ -3057,12 +3055,12 @@ } else { enviroment = { 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom button_name: '鏂板', edit_dlg: { type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d }, master: { cls_id: 'MBOX', //self.options.ExtParam.Sub_Cls.ID, // button=bottom鏃�master鐨刢ls_id @@ -3072,7 +3070,7 @@ }; } - var global_attr = this.$data.global_attr; + var global_attr = this.global_attr; if (info.global_attr) { global_attr = info.global_attr; } @@ -3104,11 +3102,11 @@ var result = action.value; for (var i = 0; i < result.length; i++) { if (result[i].choice_list) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - for (var c = 0; c < $this.$data.subPanelList[s] + for (var s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s] .subClassAttrList .length; c++) { - var attr = $this.$data.subPanelList[s].subClassAttrList[c] + var attr = $this.subPanelList[s].subClassAttrList[c] .Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { @@ -3132,10 +3130,10 @@ } } } - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList + for (var s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s].subClassAttrList .length; c++) { - var attr = $this.$data.subPanelList[s].subClassAttrList[c] + var attr = $this.subPanelList[s].subClassAttrList[c] .Attr; for (var j = 0; j < attr.length; j++) { console.log(attr[j].Name + '==' + result[i].attr); @@ -3146,16 +3144,16 @@ } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -3165,19 +3163,19 @@ } else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规 var $this = this; if (action.value.common_dlg_id == 'check_list') { - $this.$data.check_list = action.value.config; + $this.check_list = action.value.config; if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.$data.popupType = 'right'; + $this.popupType = 'right'; else - $this.$data.popupType = 'center' + $this.popupType = 'center' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.$data.popupType); + $this.$refs.popup.open($this.popupType); } } else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹� var result = action.value; var $this = this; - let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); - var scanCodeVal = $this.$data.scanCodeVal; + let list_1 = JSON.parse(JSON.stringify(this.subClassAttrList)); + var scanCodeVal = $this.scanCodeVal; var rand = ''; for (var i = 0; i < 5; i++) { //鐢熸垚5浣嶉殢鏈烘暟 rand += Math.floor(Math.random() * 10); @@ -3190,16 +3188,16 @@ if (info.attr[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹� scanCodeVal = "mast_input_3037-" + rand; } - $this.$data.subPanelList.push({ + $this.subPanelList.push({ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); for (var i = 0; i < result.length; i++) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - if ($this.$data.subPanelList[s].scanCodeVal == scanCodeVal) { + for (var s = 0; s < $this.subPanelList.length; s++) { + if ($this.subPanelList[s].scanCodeVal == scanCodeVal) { if (result[i].attr == "S_ID") - $this.$data.subPanelList[s].ObjID = result[i].value; - var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; + $this.subPanelList[s].ObjID = result[i].value; + var _subClassAttr = $this.subPanelList[s].subClassAttr; for (var c = 0; c < _subClassAttr.length; c++) { var attr = _subClassAttr[c].Attr; for (var j = 0; j < attr.length; j++) { @@ -3210,20 +3208,20 @@ } } - // $this.$data.subPanelList[s].subClassAttr=list_1; + // $this.subPanelList[s].subClassAttr=list_1; } } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -3234,21 +3232,21 @@ } if (data.result) { - let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); - var scanCodeVal = $this.$data.scanCodeVal; + let list_1 = JSON.parse(JSON.stringify(this.subClassAttrList)); + var scanCodeVal = $this.scanCodeVal; if (info.inputParamter[0].attr == "mast_input_3037") scanCodeVal = "mast_input_3037-" + ii; - $this.$data.subPanelList.push({ + $this.subPanelList.push({ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); var result = data.result; for (var i = 0; i < result.length; i++) { - for (var s = 0; s < $this.$data.subPanelList.length; s++) { - if ($this.$data.subPanelList[s].scanCodeVal == scanCodeVal) { + for (var s = 0; s < $this.subPanelList.length; s++) { + if ($this.subPanelList[s].scanCodeVal == scanCodeVal) { if (result[i].attr == "S_ID") - $this.$data.subPanelList[s].ObjID = result[i].value; - var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; + $this.subPanelList[s].ObjID = result[i].value; + var _subClassAttr = $this.subPanelList[s].subClassAttr; for (var c = 0; c < _subClassAttr.length; c++) { var attr = _subClassAttr[c].Attr; for (var j = 0; j < attr.length; j++) { @@ -3262,16 +3260,16 @@ } var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { + if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr }).length) { length = 1; - $this.$data.refdatastore.push(result[i]); + $this.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.refdatastore.length; j++) { + if ($this.refdatastore[j].attr == result[i].attr) { + $this.refdatastore[j].value = result[i].value; } } } @@ -3295,7 +3293,7 @@ }); var $this = this; var req = []; - var attrlist = $this.$data.classAttrList; + var attrlist = $this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -3337,7 +3335,7 @@ } } var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var sub_req = []; for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { @@ -3386,13 +3384,13 @@ } var dataJson = { master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, - input_3037: $this.$data.scanCodeVal, //鎵爜鍐呭 - op_type: $this.$data.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 + input_3037: $this.scanCodeVal, //鎵爜鍐呭 + op_type: $this.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } }; @@ -3408,7 +3406,7 @@ objid: '', attr: JSON.stringify([]), extinfo: JSON.stringify([]), - global_attr: JSON.stringify($this.$data.global_attr), + global_attr: JSON.stringify($this.global_attr), dataJson: JSON.stringify(dataJson) } // console.log(JSON.stringify(dataInfo)); @@ -3418,13 +3416,13 @@ uni.hideLoading(); var data = JSON.parse(success); var result = data.result; - if (eventID != $this.$data.param.After_OK_Event.ID) - $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); + if (eventID != $this.param.After_OK_Event.ID) + $this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID); else { //鍒锋柊 uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title + url: '../modal/ms_classAttr?param=' + JSON.stringify($this.param) + + "&titlename=" + $this.title }); } @@ -3446,7 +3444,7 @@ }); var $this = this; var req = []; - var attrlist = $this.$data.classAttrList; + var attrlist = $this.classAttrList; for (var i = 0; i < attrlist.length; i++) { var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { @@ -3487,7 +3485,7 @@ } } var objects = []; - var subPanelList = $this.$data.subPanelList; + var subPanelList = $this.subPanelList; for (var s = 0; s < subPanelList.length; s++) { var sub_req = []; for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { @@ -3536,13 +3534,13 @@ } var dataJson = { master_cls: { - cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, + cls_name: 'MBOX', //$this.param.Master_Cls.Name, obj_attrs: req }, - input_3037: $this.$data.scanCodeVal, //鎵爜鍐呭 - op_type: $this.$data.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 + input_3037: $this.scanCodeVal, //鎵爜鍐呭 + op_type: $this.param.OperationType, //浣滀笟绫诲瀷瀹氫箟 sub_cls: { - cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, objects: objects } }; @@ -3558,7 +3556,7 @@ objid: '', attr: JSON.stringify([]), extinfo: JSON.stringify([]), - global_attr: JSON.stringify($this.$data.global_attr), + global_attr: JSON.stringify($this.global_attr), dataJson: JSON.stringify(dataJson) } // console.log(JSON.stringify(dataInfo)); @@ -3568,13 +3566,13 @@ uni.hideLoading(); var data = JSON.parse(success); var result = data.result; - if (eventID != $this.$data.param.After_Trigger_Event.ID) - $this.scan_TriggerDataObjRunCustomEvent($this.$data.param.After_Trigger_Event.ID); + if (eventID != $this.param.After_Trigger_Event.ID) + $this.scan_TriggerDataObjRunCustomEvent($this.param.After_Trigger_Event.ID); else { //鍒锋柊 uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title + url: '../modal/ms_classAttr?param=' + JSON.stringify($this.param) + + "&titlename=" + $this.title }); } @@ -3810,7 +3808,7 @@ padding: 20rpx; line-height: 1.5; /* background: #27A6E1; */ - /* border: none; */ + /* border: none; */ background: #fff; color: #000; font-size: 38rpx; diff --git a/pages/modal/small-wnd/ext-button.vue b/pages/modal/small-wnd/ext-button.vue index 4e4a405..d73c6b3 100644 --- a/pages/modal/small-wnd/ext-button.vue +++ b/pages/modal/small-wnd/ext-button.vue @@ -11,7 +11,7 @@ <script> import { Base64 - } from "js-base64"; + } from '@/js/Base64.js'; import lua from "@/lua"; import { showError diff --git a/pages/modal/small-wnd/index.vue b/pages/modal/small-wnd/index.vue index 5eee0e3..4fdd1ee 100644 --- a/pages/modal/small-wnd/index.vue +++ b/pages/modal/small-wnd/index.vue @@ -287,7 +287,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' import utils from "@/js/utils.js" import { @@ -312,7 +314,7 @@ onBackPress(e) { // console.log("鐩戝惉杩斿洖鎸夐挳浜嬩欢",e); if (this.type) { - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, ""); } @@ -1060,7 +1062,7 @@ }, cancel(e) { if (this.type) { - var eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); eventChannel.emit(this.type, ""); } @@ -1094,7 +1096,7 @@ // console.log(e.target); var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .dictitem[e - .target.value]; + .detail.value]; var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; // console.log(data_attr); @@ -1210,9 +1212,9 @@ var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']]; // console.log(decodedata); - if (e.target.value != data_attr.Value) { + if (e.detail.value != data_attr.Value) { this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = - decodedata ? decodedata : e.target.value; + decodedata ? decodedata : e.detail.value; var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']] .action; @@ -1346,7 +1348,7 @@ showCancel: false, confirmText: this.translateSys('cancel') }); - // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; + // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; }, classAttr_AddPrj(index, iindex) { diff --git a/pages/modal/small-wnd/line.vue b/pages/modal/small-wnd/line.vue index b8eb78a..a0c0a49 100644 --- a/pages/modal/small-wnd/line.vue +++ b/pages/modal/small-wnd/line.vue @@ -87,7 +87,9 @@ </template> <script> - import Base64 from '../../components/js-base64/base64.js' + import { + Base64 + } from '@/js/Base64.js'; import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' import utils from "@/js/utils.js" export default { diff --git a/pages/selPrj/index.vue b/pages/selPrj/index.vue index 619f235..545d8a6 100644 --- a/pages/selPrj/index.vue +++ b/pages/selPrj/index.vue @@ -49,13 +49,13 @@ onLoad(options) { // console.log(options); var param = JSON.parse(options.param); - this.$data.param = param; - this.$data.relation = options.relation; - // console.log(this.$data.param); + this.param = param; + this.relation = options.relation; + // console.log(this.param); var datainfo = { - relation: this.$data.relation, + relation: this.relation, tag: '', type: '', kw: '', @@ -75,7 +75,7 @@ for (var i in list) { list[i].ischeck = false; } - this.$data.data = list; + this.data = list; }).catch(ex => { // console.log(ex); uni.showModal({ @@ -111,12 +111,12 @@ onkeyup(e) { // console.log(e.target); - // console.log(this.$data.searchVal); + // console.log(this.searchVal); var datainfo = { - relation: this.$data.priRel, + relation: this.priRel, tag: '', type: '', - kw: this.$data.searchVal, + kw: this.searchVal, pindex: 1, psize: 999999999, state: '', @@ -131,7 +131,7 @@ for (var i in list) { list[i].ischeck = false; } - this.$data.data = list; + this.data = list; }).catch(ex => { @@ -147,21 +147,21 @@ }, onchange(e) { // console.log(e.target); - var data = this.$data.data; - this.$data.data = []; + var data = this.data; + this.data = []; for (var i in data) { data[i].ischeck = false; } data[e.target.dataset.index].ischeck = e.target.dataset.ischeck ? false : true - this.$data.data = data; + this.data = data; }, sava() { //鐐瑰嚮鍔熻兘鐐硅烦杞〉闈�- // console.log(this.$data.data); + // console.log(this.data); var data = []; - for (var i in this.$data.data) { - if (this.$data.data[i].ischeck == true) { - data.push(this.$data.data[i]); + for (var i in this.data) { + if (this.data[i].ischeck == true) { + data.push(this.data[i]); } } if (data.length == 0) { @@ -173,9 +173,9 @@ }); return; } - const eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); - eventChannel.emit('AddPer', data, this.$data.param); + eventChannel.emit('AddPer', data, this.param); uni.navigateBack() }, diff --git a/pages/selpsn/index.vue b/pages/selpsn/index.vue index 2c9ec66..badd763 100644 --- a/pages/selpsn/index.vue +++ b/pages/selpsn/index.vue @@ -48,9 +48,9 @@ onLoad(options) { console.log(options); var param = JSON.parse(options.param); - this.$data.param = param; - this.$data.mulit = options.mulit; - // console.log(this.$data.param); + this.param = param; + this.mulit = options.mulit; + // console.log(this.param); }, methods: { setData(obj) { @@ -77,10 +77,10 @@ onkeyup(e) { console.log(e); - console.log(this.$data.searchVal); - if (this.$data.searchVal) { + console.log(this.searchVal); + if (this.searchVal) { var datainfo = { - jp: this.$data.searchVal, + jp: this.searchVal, dept_id: '' }; querySelPsn(datainfo).then(res => { @@ -99,7 +99,7 @@ ischeck: false }) } - this.$data.data = json; + this.data = json; }) .catch(ex => { // console.log(ex); @@ -111,26 +111,26 @@ }); }); } else - this.$data.data = []; + this.data = []; }, onchange(e) { // console.log(e.target); - var data = this.$data.data; - this.$data.data = []; - if (this.$data.mulit == "false") { + var data = this.data; + this.data = []; + if (this.mulit == "false") { for (var i in data) { data[i].ischeck = false; } } data[e.target.dataset.index].ischeck = e.target.dataset.ischeck ? false : true - this.$data.data = data; + this.data = data; }, sava() { //鐐瑰嚮鍔熻兘鐐硅烦杞〉闈� var data = []; - for (var i in this.$data.data) { - if (this.$data.data[i].ischeck == true) { - data.push(this.$data.data[i]); + for (var i in this.data) { + if (this.data[i].ischeck == true) { + data.push(this.data[i]); } } if (data.length == 0) { @@ -142,9 +142,9 @@ }); return; } - const eventChannel = this.$scope.eventChannel; + const eventChannel = this.getOpenerEventChannel(); // const eventChannel = this.getOpenerEventChannel(); - eventChannel.emit('AddPer', data, this.$data.param); + eventChannel.emit('AddPer', data, this.param); uni.navigateBack() }, diff --git a/store/index.js b/store/index.js deleted file mode 100644 index ddeeac3..0000000 --- a/store/index.js +++ /dev/null @@ -1,1690 +0,0 @@ -import Vue from 'vue' -import Vuex from 'vuex' -import Base64 from '../components/js-base64/base64.js' -import utils from "@/js/utils.js" -Vue.use(Vuex) - -import app from './modules/app' -const store = new Vuex.Store({ - modules: { - app, - Base64, - }, - state: { - hasLogin: false, - deviceId: '', - apkVersionInfo: "", - loginProvider: "", - areaFunc: '', - thisareaFuncID: '', - thisareaFuncSubID: '', - thisEditName: '', - thisEditSubName: '', - thisDictName: '', - _classAttrList: {}, - _classGridStyleInfo: {}, - _subClassAttrList: {}, - _subClassGridStyleInfo: {}, - _dicValueInfo: {}, - DataObjRunCustomEventInfo: '', - querySelpsn: '', - ProjectGetAnalysisList: '', - addclassattr: '', - DelObj: '', - username: "sa", - userpwd: "0000", - url: "139.159.144.10:8080/mobox3", //115.29.185.26:5000 - OIOrgSAPI: '', //115.29.185.26:5101 - OIMoboxSAPI: '', //115.29.185.26:5102 - OIDataSAPI: '', //115.29.185.26:5103 - OIMongodbSvr: '' //115.29.185.26:5201 - }, - mutations: { - setDeviceId(state, ret) { - state.deviceId = ret; - }, - setUrl(state, url) { - state.url = url; - }, - setOrgSApi(state, url) { - state.OIOrgSAPI = url; - }, - setMobxoSApi(state, url) { - state.OIMoboxSAPI = url; - }, - setDataSApi(state, url) { - state.OIDataSAPI = url; - }, - setMongodbSvr(state, url) { - state.OIMongodbSvr = url; - }, - setApkVersionInfo(state, ret) { - state.apkVersionInfo = ret; - }, - login(state, provider) { - state.hasLogin = true; - state.loginProvider = provider; - }, - areaFunc(state, ret) { - state.areaFunc = ret; - }, - setareaFuncid(state, id) { - state.thisareaFuncID = id; - }, - setareaFunSubcid(state, id) { - state.thisareaFuncSubID = id; - }, - seteditName(state, editName) { - state.thisEditName = editName; - }, - seteditSubName(state, editName) { - state.thisEditSubName = editName; - }, - setDictName(state, dictName) { - state.thisDictName = dictName; - }, - classAttrList(state, ret) { - // state._classAttrList[state.thisareaFuncID] = ret; - Vue.set(state._classAttrList, state.thisareaFuncID, ret); - }, - classGridStyleInfo(state, ret) { - // state._classGridStyleInfo[state.thisareaFuncID] = ret; - var data = {}; - if (state._classGridStyleInfo[state.thisareaFuncID]) - data = state._classGridStyleInfo[state.thisareaFuncID]; - Vue.set(data, state.thisEditName, ret); - Vue.set(state._classGridStyleInfo, state.thisareaFuncID, data); - }, - subClassAttrList(state, ret) { - Vue.set(state._subClassAttrList, state.thisareaFuncSubID, ret); - }, - subClassGridStyleInfo(state, ret) { - var data = {}; - if (state._subClassGridStyleInfo[state.thisareaFuncSubID]) - data = state._subClassGridStyleInfo[state.thisareaFuncSubID]; - Vue.set(data, state.thisEditSubName, ret); - Vue.set(state._subClassGridStyleInfo, state.thisareaFuncSubID, data); - }, - dicValueInfo(state, ret) { - // state._dicValueInfo[state.thisareaFuncID] = ret; - Vue.set(state._dicValueInfo, state.thisDictName, ret); - }, - DataObjRunCustomEventInfo(state, ret) { - state.DataObjRunCustomEventInfo = ret; - }, - querySelpsn(state, ret) { - state.querySelpsn = ret; - }, - ProjectGetAnalysisList(state, ret) { - state.ProjectGetAnalysisList = ret; - }, - addclassattr(state, ret) { - state.addclassattr = ret; - }, - DelObj(state, ret) { - state.DelObj = ret; - }, - logout(state) { - state.hasLogin = false - }, - }, - getters: { - getDeviceId(state, ret) { - return state.deviceId - }, - GetApkServionInfo(state) { - return state.apkVersionInfo - }, - loginid(state) { - return state.loginProvider.loginid - }, - getUrl(state) { - return state.url - }, - getOrgSApi(state, url) { - return state.OIOrgSAPI; - }, - getMobxoSApi(state, url) { - return state.OIMoboxSAPI; - }, - getDataSApi(state, url) { - return state.OIDataSAPI; - }, - getMongodbSvr(state, url) { - return state.OIMongodbSvr; - }, - getclassAttrList(state) { - return state._classAttrList[state.thisareaFuncID]; - }, - getclassGridStyleInfo(state) { - if (state._classGridStyleInfo[state.thisareaFuncID]) - return state._classGridStyleInfo[state.thisareaFuncID][state.thisEditName]; - else - return ""; - }, - getSubClassAttrList(state) { - return state._subClassAttrList[state.thisareaFuncSubID]; - }, - getSubClassGridStyleInfo(state) { - if (state._subClassGridStyleInfo[state.thisareaFuncSubID]) - return state._subClassGridStyleInfo[state.thisareaFuncSubID][state.thisEditSubName]; - else - return ""; - }, - getdicValueInfo(state) { - return state._dicValueInfo[state.thisDictName]; - } - - - }, - actions: { - //{commit} 瑙f瀯锛�- //univerifyInfo 鑷畾涔夊弬鏁�- GetApkVersionInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - univerifyInfo = univerifyInfo || {}; - univerifyInfo.server = univerifyInfo.server || ''; - if (univerifyInfo.server.length == 0) { - reject({ - "errMsg": '鏈嶅姟鍣ㄥ湴鍧�笉鑳戒负绌�' - }); - } - var openinfo = "http://" + univerifyInfo.server + "/"; //+"/OrgWebS" - if (univerifyInfo.server.includes("://")) { - openinfo = univerifyInfo.server + "/" - } - //璁剧疆鍏ㄥ眬鍙傛暟锛歶rl-鏈嶅姟鍣ㄥ湴鍧�- commit("setUrl", openinfo); - // var ser = univerifyInfo.server.split('/'); - // if(ser[1] == 'mobox3'){ - // // reject({"errMsg":"Mobox3鏆傛椂鏈敮鎸佽嚜鍔ㄦ洿鏂帮紒"}); - // resolve({code:'00000',data:"",msg:""}); - // return; - // } - uni.request({ - url: openinfo + "PDA/GetApkVersionInfo", - data: {}, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - console.log(res); - if (res.statusCode == 404) { - reject({ - "errMsg": "鍦板潃涓嶅锛岃妫�煡璇ュ湴鍧�細" + openinfo + - ",鏂规硶锛欸etApkVersionInfo,鏄惁姝g‘" - }); - } else if (res.statusCode == 500) { - reject({ - "errMsg": "鏈壘鍒版洿鏂板寘鎵�湪鐩綍锛� - }); - } - const ret = res.data - if (ret.code == '00000') { - commit("setApkVersionInfo", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - login: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - univerifyInfo = univerifyInfo || {}; - univerifyInfo.server = univerifyInfo.server || ''; - univerifyInfo.uname = univerifyInfo.uname || ''; - univerifyInfo.pwd = univerifyInfo.pwd || ''; - if (univerifyInfo.server.length == 0) { - reject({ - "errMsg": '鏈嶅姟鍣ㄥ湴鍧�笉鑳戒负绌�' - }); - } - if (univerifyInfo.uname.length < 2) { - reject({ - "errMsg": '璐﹀彿鏈�煭涓�2 涓瓧绗�' - }); - } - if (univerifyInfo.pwd.length < 1) { - reject({ - "errMsg": '瀵嗙爜鏈�煭涓�1涓瓧绗�' - }); - } - var openinfo = "http://" + univerifyInfo.server + "/"; - if (univerifyInfo.server.includes("://")) { - openinfo = univerifyInfo.server + "/" - } - //璁剧疆鍏ㄥ眬鍙傛暟锛歶rl-鏈嶅姟鍣ㄥ湴鍧�- commit("setUrl", openinfo); - var ser = univerifyInfo.server.toLowerCase().split('/'); - var url = openinfo + "PDA/SignIn"; - var header = { - 'content-type': 'application/x-www-form-urlencoded' - }; - commit("setOrgSApi", ''); - commit("setMobxoSApi", ''); - commit("setDataSApi", ''); - commit("setMongodbSvr", ''); - if (ser[ser.length - 1] == 'mobox3') { //鍒ゆ柇鍦板潃鏄惁鏄疢obox3 - - const orgsport = univerifyInfo.orgsport || 5101 - const moboxsport = univerifyInfo.moboxsport || 5102 - const datasport = univerifyInfo.datasport || 5103 - const mongodbsport = univerifyInfo.mongodbsport || 5201 - - var orgSApi = "http://" + ser[0].split(':')[0] + ":" + orgsport + "/"; - var mobxoSApi = "http://" + ser[0].split(':')[0] + ":" + moboxsport + "/"; - var dataSApi = "http://" + ser[0].split(':')[0] + ":" + datasport + "/"; - var mongodbSvr = "http://" + ser[0].split(':')[0] + ":" + mongodbsport + "/"; - if (univerifyInfo.server.includes("://")) { - orgSApi = ser[0] + "//" + ser[2].split(':')[0] + ":" + orgsport + "/"; - mobxoSApi = ser[0] + "//" + ser[2].split(':')[0] + ":" + moboxsport + "/"; - dataSApi = ser[0] + "//" + ser[2].split(':')[0] + ":" + datasport + "/"; - mongodbSvr = ser[0] + "//" + ser[2].split(':')[0] + ":" + mongodbsport + - "/"; - } - commit("setOrgSApi", orgSApi); - commit("setMobxoSApi", mobxoSApi); - commit("setDataSApi", dataSApi); - commit("setMongodbSvr", mongodbSvr); - url = orgSApi + 'api/user/ace/VerifyPassword'; - univerifyInfo = { - app_type: "mobox", - user_login: Base64.encode(univerifyInfo.uname), - user_psw: Base64.encode(univerifyInfo.pwd), - client_info: { - type: 3, //瀹㈡埛绔被鍨嬶細0鈥揚C锛�鈥揥EB锛�鈥撳畨鍗擄紝3鈥撳畨鍗揚AD锛�鈥搃Phone锛�5鈥搃Pad锛�6鈥撳叾瀹�- num: state.deviceId //PDA鐨勮澶囧彿 - } - }; - header = {}; - } - console.log(univerifyInfo); - uni.request({ - url: url, - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: header, - success: (res) => { - console.log(res); - const ret = res.data - if (ret.code == '00000' || ret.err_code == 0) { - commit("login", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg ? ret.msg : ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - areaFunc: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - var url = state.url + "PDA/PDAArea"; - var header = { - 'content-type': 'application/x-www-form-urlencoded' - }; - if (state.OIMoboxSAPI) { //鍒ゆ柇鏄惁鏄疢obox3 - url = state.OIMoboxSAPI + 'api/app/area/GetList?sessionid=' + state - .loginProvider.loginid.result.session_id; - univerifyInfo = { - app_type: univerifyInfo.app_type || "MES", - }; - header = {}; - } - - uni.request({ - url: url, - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: header, - success: (res) => { - console.log(res); - if (res.statusCode == 404) { - reject({ - "errMsg": "鍦板潃涓嶅锛岃妫�煡璇ュ湴鍧�細" + openinfo - }); - } - // if(JSON.stringify(res.data).includes('Login Page - Ace Admin')){ - // uni.reLaunch({ - // url: '../login/index' - // }) - // reject({"errMsg":"鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�}); - // } - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哸reaFunc銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000' || ret.err_code == 0) { - commit("areaFunc", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // Mobox3鑾峰彇搴旂敤棰嗗煙涓嬬殑鍔熻兘鐐�- GetFuncTree: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - uni.request({ - url: state.OIMoboxSAPI + 'api/app/GetFuncTree?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏咷etFuncTree銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.err_code == 0) { - // commit("areaFunc",ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - classAttrList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - - uni.request({ - url: state.url + "PDA/PDAAttrList", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - console.log(res); - // if(JSON.stringify(res.data).includes('Login Page - Ace Admin')){ - // uni.reLaunch({ - // url: '../login/index' - // }) - // reject({"errMsg":"鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�}); - // } - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哻lassAttrList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - commit("classAttrList", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - classGridStyleInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - - uni.request({ - url: state.url + "PDA/PDAGridStyleGetInfo", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哻lassGridStyleInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - // var data ={}; - // Vue.set(data,univerifyInfo.name,ret); - commit("classGridStyleInfo", ret); - resolve(ret); - } else { - - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - subClassAttrList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - - uni.request({ - url: state.url + "PDA/PDAAttrList", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - console.log(res); - // if(JSON.stringify(res.data).includes('Login Page - Ace Admin')){ - // uni.reLaunch({ - // url: '../login/index' - // }) - // reject({"errMsg":"鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�}); - // } - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏唖ubClassAttrList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - commit("subClassAttrList", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - subClassGridStyleInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - - uni.request({ - url: state.url + "PDA/PDAGridStyleGetInfo", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - - console.log(res); - // if(JSON.stringify(res.data).includes('Login Page - Ace Admin')){ - // uni.reLaunch({ - // url: '../login/index' - // }) - // reject({"errMsg":"鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�}); - // } - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏唖ubClassGridStyleInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - // var data ={}; - // Vue.set(data,univerifyInfo.name,ret); - commit("subClassGridStyleInfo", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - dicValueInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - - uni.request({ - url: state.url + "PDA/PDADicValueGetInfo", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - // console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哾icValueInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - state.thisDictName = univerifyInfo.dic_name - commit("dicValueInfo", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - DataObjRunCustomEventInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - uni.request({ - url: state.url + "PDA/PDADataObjRunCustomEvent", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - // console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏咲ataObjRunCustomEventInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000') { - commit("DataObjRunCustomEventInfo", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - querySelpsn: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - var url = state.url + "selpsn/queryjson"; - var datajson = univerifyInfo; - var header = { - 'content-type': 'application/x-www-form-urlencoded' - }; - if (state.OIOrgSAPI) { //鍒ゆ柇鏄惁鏄疢obox3 - url = state.OIOrgSAPI + 'api/user/query/query?sessionid=' + state.loginProvider - .loginid.result.session_id; - datajson = { - query_str: univerifyInfo.jp, - }; - header = {}; - } - uni.request({ - url: url, - data: datajson, - method: 'POST', - dataType: "json", - header: header, - success: (res) => { - // console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏唓uerySelpsn銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.code == '00000' || ret.err_code == 0) { - commit("querySelpsn", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - ProjectGetAnalysisList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - var url = state.url + "bpm/ProjectGetAnalysisList"; - var header = { - 'content-type': 'application/x-www-form-urlencoded' - }; - if (state.OIMoboxSAPI) { //鍒ゆ柇鏄惁鏄疢obox3 - // url = state.OIMoboxSAPI+'api/app/area/GetList?sessionid='+state.loginProvider.loginid.result.session_id; - // univerifyInfo = { - // app_type: "MES", - // }; - // header={}; - reject({ - "errMsg": "Mobox3鏆傛椂鏈敮鎸侀�鎷╅」鐩帴鍙o紒" - }); - // resolve({code:'00000',data:"",msg:""}); - return; - } - - uni.request({ - url: url, - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: header, - success: (res) => { - console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哖rojectGetAnalysisList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - if (ret.code == '00000') { - commit("ProjectGetAnalysisList", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.msg || ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - addclassattr: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - univerifyInfo.loginInfo = JSON.stringify({ - server: utils.session.getValue('server'), - uname: utils.session.getValue('account'), - pwd: utils.session.getValue('password'), - cname: plus.device.model, - type: "0" - }); - uni.request({ - url: state.url + "PDA/addclassattr", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - // console.log(res); - // if(JSON.stringify(res.data).includes('Login Page - Ace Admin')){ - // uni.reLaunch({ - // url: '../login/index' - // }) - // reject({"errMsg":"鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�}); - // } - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哸ddclassattr銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - if (ret.code == '00000') { - commit("addclassattr", ret); - resolve(ret); - } else { - reject({ - "errMsg": JSON.stringify(ret) - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - DelObj: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.url + "PDA/DelObj", - data: univerifyInfo, - method: 'POST', - dataType: "json", - header: { - 'content-type': 'application/x-www-form-urlencoded' - }, - success: (res) => { - console.log(res); - var ret = res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏咲elObj銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - if (ret.code == '00000') { - commit("DelObj", ret); - resolve(ret); - } else { - reject({ - "errMsg": JSON.stringify(ret) - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - - // api/class/attr/GetList?sessionid=SESSION_ID - // Mobox3寰楀埌鏁版嵁绫诲睘鎬�- classAttrGetList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.OIDataSAPI + 'api/class/attr/GetList?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哻lassAttrGetList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - if (ret.err_code == 0) { - commit("classAttrList", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/class/attr/GetList?sessionid=SESSION_ID - // Mobox3寰楀埌鏁版嵁绫诲睘鎬�- subClassAttrGetList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.OIDataSAPI + 'api/class/attr/GetList?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏唖ubClassAttrGetList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.err_code == 0) { - commit("subClassAttrList", ret); - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/dict/item/GetInfo?sessionid=SESSION_ID - // Mobox3寰楀埌瀛楀吀椤瑰垪琛�- DictItemGetList: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.OIMoboxSAPI + 'api/dict/item/GetInfo?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏咲ictItemGetList銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/dict/GetInfo2?sessionid=SESSION_ID - // Mobox3寰楀埌瀛楀吀淇℃伅 - DictGetInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.OIMoboxSAPI + 'api/dict/GetInfo2?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏咲ictGetInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - // api/dataobj/Create?sessionid=SESSION_ID - // Mobox3鍒涘缓鏁版嵁瀵硅薄 - createDataObj: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.url); - uni.request({ - url: state.OIDataSAPI + 'api/dataobj/Create?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哻reateDataObj銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - - - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg - }); - } - }, - fail: (err) => { - console.log(err); - reject(err); - } - }) - }) - }, - - // api/class/uistyle/GetInfo?sessionid=SESSION_ID - // Mobox3寰楀埌鏁版嵁绫绘樉绀烘牱寮忎俊鎭�- UIStyleGetInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - // console.log(state.OIDataSAPI) - uni.request({ - url: state.OIDataSAPI + 'api/class/uistyle/GetInfo?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哢IStyleGetInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg || ret.errMsg - }); - } - }, - fail: (err) => { - console.log("fail", err); - reject(err); - } - }) - }) - }, - // api/dataobj/RunCustomEvent?sessionid=SESSION_ID - // Mobox3鎵ц鑷畾涔夎剼鏈�- runCustomEvent: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - uni.request({ - url: state.OIDataSAPI + 'api/dataobj/RunCustomEvent?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏唕unCustomEvent銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg || ret.errMsg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/dataobj/Delete?sessionid=SESSION_ID - // Mobox3鍒犻櫎鏁版嵁瀵硅薄 - dataObjDel: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - uni.request({ - url: state.OIDataSAPI + 'api/dataobj/Delete?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哾ataObjDel銆恓son string銆戣浆鎹负銆恓son object銆戝け璐�) - } - } - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg || ret.errMsg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/dataobj/query/Query?sessionid=SESSION_ID - // Mobox3鏌ヨ鏁版嵁瀵硅薄 - dataObjQuery: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - uni.request({ - url: state.OIDataSAPI + 'api/dataobj/query/Query?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哾ataObjQuery銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg || ret.errMsg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - // api/app/GetInfo?sessionid=SESSION_ID - // Mobox3鑾峰彇鍔熻兘鐐逛俊鎭�- appGetInfo: function({ - commit, - state - }, univerifyInfo) { - return new Promise((resolve, reject) => { - // console.log(state.loginProvider.loginid.result.session_id); - uni.request({ - url: state.OIMoboxSAPI + 'api/app/GetInfo?sessionid=' + state - .loginProvider.loginid.result.session_id, - data: univerifyInfo, - method: 'POST', - dataType: "json", - success: (_res) => { - // console.log(_res); - var ret = _res.data - if (typeof ret == 'string') { - try { - try { - try { - ret = JSON.parse(ret.replace(/\\"/g, '"')); - } catch (ex) { - ret = JSON.parse(ret.replace(/\\/g, '\\\\')) - } - } catch (ex) { - ret = JSON.parse(ret.replace(/\\"/g, "'").replace( - /[\r\n]/g, - '<br>').replace(/[\t]/g, ' ')); - } - } catch (ex) { - console.log(ret) - return reject( - '灏哸ppGetInfo銆恓son string銆戣浆鎹负銆恓son object銆戝け璐� - ) - } - } - if (ret.err_code == 0) { - resolve(ret); - } else { - reject({ - "errMsg": ret.err_msg || ret.errMsg - }); - } - }, - fail: (err) => { - // console.log(err); - reject(err); - } - }) - }) - }, - - } -}) - -export default store \ No newline at end of file diff --git a/store/modules/app.js b/store/modules/app.js deleted file mode 100644 index acbb187..0000000 --- a/store/modules/app.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - state: { - appInfo:"Bullllllllll" - }, - mutations: { - setAppInfo(state, value) { - state.appInfo= value; - } - }, - actions: { - setAppInfoAction({ commit }, value) { - commit("setAppInfo", value); - }, - }, - getters:{} -}; \ No newline at end of file diff --git a/store/modules/user.js b/store/modules/user.js deleted file mode 100644 index c2f13e8..0000000 --- a/store/modules/user.js +++ /dev/null @@ -1,17 +0,0 @@ -export default { - state: { - appInfo:'', - hasLogin:'', - }, - mutations: { - setAppInfo(state, value) { - state.appInfo= value; - } - }, - actions: { - setAppInfoAction({ commit }, value) { - commit("setAppInfo", value); - }, - }, - getters:{} -}; \ No newline at end of file diff --git a/uni_modules/select-cy/components/select-cy/select-cy.vue b/uni_modules/select-cy/components/select-cy/select-cy.vue index 6400d45..dcd22b0 100644 --- a/uni_modules/select-cy/components/select-cy/select-cy.vue +++ b/uni_modules/select-cy/components/select-cy/select-cy.vue @@ -86,7 +86,7 @@ default: 'value' }, // 鏄惁寮�惎鍒嗛〉 - isPaging:{ + isPaging: { type: Boolean, default: false } @@ -98,10 +98,10 @@ realValue: [] }; }, - watch:{ - value:{ - deep:true, - handle(val){ + watch: { + value: { + deep: true, + handle(val) { //鍒濆鍖� this.init(); } @@ -126,11 +126,11 @@ this.realValue = []; } }, - scrolltolower(){ - if(this.isPaging){ + scrolltolower() { + if (this.isPaging) { this.$emit('scrolltolower') } - + }, //鐐瑰嚮灞曠ず閫夐」 handleSelect() { @@ -139,9 +139,12 @@ }, //绉婚櫎鏁版嵁 handleRemove(index) { - var delvalue=[]; - for(var i in this.changevalue){ - delvalue.push({attr:this.changevalue[i].attr,Name:this.changevalue[i].Name}); + var delvalue = []; + for (var i in this.changevalue) { + delvalue.push({ + attr: this.changevalue[i].attr, + Name: this.changevalue[i].Name + }); } if (index === null) { this.realValue = []; @@ -232,6 +235,7 @@ flex: 1; width: 0; flex-wrap: nowrap; + .uni-select-multiple-item { background: #bbb; margin-right: 5rpx; @@ -240,8 +244,8 @@ color: #fff; display: flex; flex: 0 0 140rpx; - - .uni-select-multiple-item-row{ + + .uni-select-multiple-item-row { flex: 1; overflow: hidden; text-overflow: ellipsis; @@ -265,6 +269,7 @@ font-size: 14px; color: #999; flex-wrap: nowrap; + .uni-disabled { position: absolute; left: 0; @@ -385,7 +390,8 @@ &.active { color: #409eff; - background-color: #f5f7fa &:hover { + background-color: #f5f7fa; + &:hover { color: #409eff; background-color: #f5f7fa } @@ -397,4 +403,4 @@ } } } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.1