diff --git a/package-lock.json b/package-lock.json index d3045e3..4671718 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1030,7 +1030,6 @@ "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz", "integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==", - "dev": true, "requires": { "regenerator-runtime": "^0.13.2" } @@ -1186,6 +1185,21 @@ "node-fetch": "^2.3.0" } }, + "@riophae/vue-treeselect": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@riophae/vue-treeselect/-/vue-treeselect-0.4.0.tgz", + "integrity": "sha512-J4atYmBqXQmiPFK/0B5sXKjtnGc21mBJEiyKIDZwk0Q9XuynVFX6IJ4EpaLmUgL5Tve7HAS7wkiGGSti6Uaxcg==", + "requires": { + "@babel/runtime": "^7.3.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "easings-css": "^1.0.0", + "fuzzysearch": "^1.0.3", + "is-promise": "^2.1.0", + "lodash": "^4.0.0", + "material-colors": "^1.2.6", + "watch-size": "^2.0.0" + } + }, "@sindresorhus/is": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", @@ -2063,6 +2077,11 @@ } } }, + "babel-helper-vue-jsx-merge-props": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", + "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==" + }, "babel-loader": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz", @@ -3993,6 +4012,11 @@ "stream-shift": "^1.0.0" } }, + "easings-css": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/easings-css/-/easings-css-1.0.0.tgz", + "integrity": "sha512-7Uq7NdazNfVtr0RNmPAys8it0zKCuaqxJStYKEl72D3j4gbvXhhaM7iWNbqhA4C94ygCye6VuyhzBRQC4szeBg==" + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -5430,6 +5454,11 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "fuzzysearch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fuzzysearch/-/fuzzysearch-1.0.3.tgz", + "integrity": "sha1-3/yA9tawQiPyImqnndGUIxCW0Ag=" + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -7007,8 +7036,7 @@ "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash-es": { "version": "4.17.15", @@ -7160,6 +7188,11 @@ "object-visit": "^1.0.0" } }, + "material-colors": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", + "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" + }, "material-design-icons-iconfont": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/material-design-icons-iconfont/-/material-design-icons-iconfont-4.0.3.tgz", @@ -9389,8 +9422,7 @@ "regenerator-runtime": { "version": "0.13.2", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", - "dev": true + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" }, "regenerator-transform": { "version": "0.14.1", @@ -11651,6 +11683,11 @@ "integrity": "sha512-Mry2sO4kiAG64714X1CFpTA/shUH1DmkZ26DFDtwoM/yyx6OtMrc+MxrU+7vvbNLO9LSpgwkiJ8W+rlmRtsM+w==", "dev": true }, + "watch-size": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/watch-size/-/watch-size-2.0.0.tgz", + "integrity": "sha512-M92R89dNoTPWyCD+HuUEDdhaDnh9jxPGOwlDc0u51jAgmjUvzqaEMynXSr3BaWs+QdHYk4KzibPy1TFtjLmOZQ==" + }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", diff --git a/package.json b/package.json index 5dcaa8e..1696e54 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@ckeditor/ckeditor5-font": "^11.2.1", "@ckeditor/ckeditor5-vue": "^1.0.0-beta.2", "@fortawesome/fontawesome-free": "^5.5.0", + "@riophae/vue-treeselect": "^0.4.0", "ajv": "^6.10.0", "apexcharts": "^3.8.3", "apollo-boost": "^0.4.3", diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 649c403..a74f7ad 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,6 +1,6 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=b5f905ff1ac688651a5b", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=1a90d1e9fc805200faab", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=05cf114c9b8d0aeeeb5c", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=ffa76709d0a81fd79236" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=b35f9bb66dd6f92a81da", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=10d74a8d32acd6f8ba07", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=a5887fa0b5bccea8d02c", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=5089292949251a6ac964" } diff --git a/resources/js/Global/components/Modals/Helper.vue b/resources/js/Global/components/Modals/Helper.vue index 6d819fd..748c947 100644 --- a/resources/js/Global/components/Modals/Helper.vue +++ b/resources/js/Global/components/Modals/Helper.vue @@ -4,15 +4,15 @@
{{ properties.message || 'پیام'}}
+ >{{ properties.description || 'پیام'}}
@@ -54,13 +54,18 @@ export default { } }, }, - async created() { - if (this.modal) { - let response = await axios.get(url('helpers', {helper: this.getModal(this.$options.name).slug})); - if (response && response.status == 200) { - this.properties = response.data.data; + methods: { + async getDate() { + if (this.modal) { + let response = await axios.get(url('help', {help: this.getModal(this.$options.name).slug})); + if (response && response.status == 200) { + this.properties = response.data.data; + } } } }, + created() { + this.getDate(); + }, }; diff --git a/resources/js/Global/utils/common/ProcessTreeArray.js b/resources/js/Global/utils/common/ProcessTreeArray.js index ca6dc6a..1df7519 100644 --- a/resources/js/Global/utils/common/ProcessTreeArray.js +++ b/resources/js/Global/utils/common/ProcessTreeArray.js @@ -66,6 +66,30 @@ const convertTreeToList = data => { return recursiveFunction(data, 1); }; + +const readyForTreeSelect = tree => { + function removechildEmpty(array) { + for (const node of array) { + if (node.id == null) { + node.id = 0; + } + node.label = node.name; + if (Array.isArray(node.children) && node.children.length == 0) { + delete node.children; + } else { + if (Array.isArray(node.children)) { + removechildEmpty(node.children); + } + } + } + } + if (Array.isArray(tree)) { + removechildEmpty(tree); + } + + return tree; +} + const convertListToTree = list => { var object = []; for (const key in list) { @@ -278,5 +302,6 @@ export { insertTreeArray, updateTreeArray, deleteTreeArray, - listSearchSelect + listSearchSelect, + readyForTreeSelect }; diff --git a/resources/js/Global/utils/date/date.js b/resources/js/Global/utils/date/date.js new file mode 100644 index 0000000..669a491 --- /dev/null +++ b/resources/js/Global/utils/date/date.js @@ -0,0 +1,16 @@ + +const formatToYMD = function (date = null, split = "-" ) { + if (!date) { + date = new Date(); + } + let month = `${date.getMonth() + 1}`; + let day = `${date.getDate()}`; + const year = date.getFullYear(); + + if (month.length < 2) month = `0${month}`; + if (day.length < 2) day = `0${day}`; + + return [year, month, day].join(split); +} + +export {formatToYMD}; \ No newline at end of file