|
@@ -1,23 +1,35 @@
|
|
|
import tools from "@/utils/scan/tools"
|
|
|
let tagsFun = (instance, td, row, col, prop, value, cellProperties) => {
|
|
|
- if (!!value) {
|
|
|
- let arr = value || [],
|
|
|
- dom = ``;
|
|
|
- arr.map(item => {
|
|
|
- dom += `<span style="display: inline-block;line-height:25px;padding: 0px 10px;background: #FFF5E4;border: 1px solid #F5A623;border-radius: 100px;font-size: 12px;color: #F5A623;text-align: center;">${item}</span>`
|
|
|
- })
|
|
|
- td.innerHTML = dom
|
|
|
- return td;
|
|
|
- }
|
|
|
- return td
|
|
|
+ if (!!value) {
|
|
|
+ let arr = value || [],
|
|
|
+ dom = ``;
|
|
|
+ arr.map(item => {
|
|
|
+ dom += `<span style="display: inline-block;line-height:25px;padding: 0px 10px;background: #FFF5E4;border: 1px solid #F5A623;border-radius: 100px;font-size: 12px;color: #F5A623;text-align: center;">${item}</span>`
|
|
|
+ })
|
|
|
+ td.innerHTML = dom
|
|
|
+ return td;
|
|
|
}
|
|
|
- /**
|
|
|
- *
|
|
|
- * @param {表头数组} arr
|
|
|
- * @param {添加的参数} '
|
|
|
- *
|
|
|
- * @returns {对应数组} arr
|
|
|
- */
|
|
|
+ return td
|
|
|
+}
|
|
|
+
|
|
|
+let switchRenderer = (instance, td, row, col, prop, value, cellProperties) => {
|
|
|
+ // td.innerHTML = value
|
|
|
+ if (value) {
|
|
|
+ td.innerHTML = `<div role="switch" class="el-switch is-checked" aria-checked="true"><input type="checkbox" name="" true-value="true" class="el-switch__input"><!----><span class="el-switch__core" style="width: 40px; border-color: rgb(19, 206, 102); background-color: rgb(19, 206, 102);"></span><!----></div>`
|
|
|
+ } else {
|
|
|
+ td.innerHTML = `<span class="el-switch__core" style="width: 40px; border-color: #dcdfe6; background-color: #dcdfe6;"></span>`
|
|
|
+ }
|
|
|
+ return td
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {表头数组} arr
|
|
|
+ * @param {添加的参数} '
|
|
|
+ *
|
|
|
+ * @returns {对应数组} arr
|
|
|
+ */
|
|
|
|
|
|
export function showTypes(arr, infosKey = '') {
|
|
|
let data = arr.map(item => {
|
|
@@ -147,6 +159,12 @@ export function showTypes(arr, infosKey = '') {
|
|
|
data: item.DataSource || ""
|
|
|
}
|
|
|
}
|
|
|
+ } else if (item.InputMode == 'switchBtn') {
|
|
|
+ return {
|
|
|
+ data: infosKey + item.InfoPointCode,
|
|
|
+ renderer: switchRenderer,
|
|
|
+ readOnly: true
|
|
|
+ }
|
|
|
} else {
|
|
|
return undefined;
|
|
|
}
|